Home arrow static arrow Java Programming [Archive] - key based compression
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - key based compression
1 Duke Stars available
This topic has 3 replies on 1 page.

Posts:3
Registered: 8/2/04
key based compression  
Aug 3, 2004 11:29 AM



 
i want to compress a file throgh java but i want to compress in such a way that it will take password n then compress the file n at the time of extratction it will verify password n then extract the file.
thanks.
 

Posts:1,906
Registered: 97-08-23
Re: key based compression  
Aug 3, 2004 11:37 AM (reply 1 of 3)



 
You're conflating encryption and compression. Encrypting a file doesn't compress it - in fact, many algorithms will cause your data to grow, depending on the blocksize and padding-mode you use.

Since compression works by detecting patterns, and encryption works very hard not to have patterns in the ciphertext, it's usually a good idea to compress your data, and then encrypt it. Coming back, you decrypt, and then decompress. It's always a two-step process.

Take a look at the Cipher class, using something like PBEWITHMD5ANDDES as your algorithm. Look up "Password Based Encryption" (PBE) for details. There have been several/many discussions in the Cryptography forum here on the developer site.

Grant
 

Posts:6,750
Registered: 1/25/04
Re: key based compression  
Aug 3, 2004 12:22 PM (reply 2 of 3)



 
It's really annoying when people shorten their words n stuff. Especially when it's really short words already like 2 or u or n. Wn u r lazy n do tht 2 much s hard 2 read.
 

Posts:19
Registered: 8/3/04
Re: key based compression  
Aug 3, 2004 12:29 PM (reply 3 of 3)



 
So in other words, you want the encryption and compression N'Sync?
 
This topic has 3 replies on 1 page.