p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

java_howto thread: Java.Security


Message #1 by Liming Xu <lxu@t...> on Thu, 1 Mar 2001 12:14:00 -0500
> Hello, coudl some one teaches me how to encrypt a string and then decrypt
> the same string?
> 
> I used java.security.* class, and I used messageDigest(MD5)
> alogrithem....the string is now encrypted...but how do I decrypt 
it????????
> please help..... links to other tutorial sites will be also helpful.
> 

As I understand it, the purpose of a message digest is not to 
encrypt/decrypt but to prevent undetectable tampering.  It acts as a check 
sum of the message and is usually much smaller than the message itself and 
so cannot be reversed (i.e. there is no undigest function).

How to encrypt depends on how secure you want or need the information to 
be, something as simple as moving on every character by an arbitrary 
amount might be OK for minimum security, while a book like
"Applied Cryptography" by Bruce Schneider (Wiley) is essential reading for 
taking on the securty services.

  Return to Index