Encrypt & Decript A Stream

Hello

In my application, I want to encrypt a stream with password. But the gzip did not have a password method.

So is it someone tell me how encrypt with a key or something else, like RAS, DES, MD5...?

I have really no idea about this, so please offer me a simple way to do this (a demo will be better).

Thanks in advance!

...

OutputStream os = file_conn.openOutputStream ();

Gzip GZIPOutputStream = new GZIPOutputStream (os, 1);

gzip. Write (buffer);

...

InputStream is = file.openInputStream ((InputStream));
Gzip GZIPInputStream = new GZIPInputStream (is);

gzip. Read (target)

Most of the people when "Encrypting" a password don't encrypt using a common encryption process, they use a one-way process such as MD5 and don't remember the password in MD5 format.  All platforms implement the same MD5 digest and then the password is passed around this more secure form.

If you get a password or try to use a password to secure data?

That said, I think you will find that it is not possible to write an encryption process that works on a stream.  So I think that you have to change this procedure to read the data into a buffer encryption here.

Look for the javadoc for something like AESEncryptorEngine, you will find some links to examples that should help you to use.

One last thing, for a file gzip, gzip compresses the data, so you encrypt the first 16 bytes (header) you perform archive gzip practically useless, so if you are concerned about performance, then encrypt only the first 16 bytes.  However if the gzip process does not have the compressed data (as it happens) it will be in the clear, it must encrypt the entire file.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • Check if iPhone had first lock the operator

    We know, there are companies that claim to unlock operator locked iPhone. There is no iPhone dealer in my country. There is therefore no way of knowing if I'll buy a new iPhone that was initially locked by an operator, and the seller it unlocked with

  • How can I change the size of the photo book

    I have a photo book that is ready to submit, but I would like to change the size 'Large' to 'Extra Large' size.

  • Update of HP DV6-2129el UC

    Recreational salvation, I want to upgrade my CPU. In fact, my laptop is equipped (AIDA64 sheet): Nome processore Intel (r) Core i5 CPU M 430 2.27 GHzLine 00020652:ID of marca (Intel architecture) 00 h (unknown)Piattaforma ID 27 h/MC 10 h (rPGA988A)Ag

  • How to add or subtract a constant from a time channel?

    I have a time string with an offset I want to remove. How can I do this? Medium using simple arithmetic that I need to know how time and dates are stored internally, but I can't determine this in the online help. for example say I have to subtract 1.

  • Should what Messenger I use in my Windows environment?

    The community of users as a whole: You wanted to get an idea of what other users think.  I am using and old XP SP3 system + with a great mix of older apps from 2000 to 2012.  In the past, I used yahoo and aol and MSN Live.  I reject yahoo and aol, to