Short answer : You can't !
MD5 stands for Message Digest 5
It's a one way fonction which computes a text's digest.
You can't decrypt a MD5 digest.
You usually use it to check that the digest of the value just entered is equal to the digest stored.
(usually passwd management works this way)
Use other usual encryption schemes if you want to decrypt text.
(RIJNDAEL, RSA, ELGAMAL...)
UPDATE :
I warmly recommend btrott's impressive work (Crypt::OpenPGP)
which handles several schemes
(IDEA, DES3, Blowfish, Rijndael, Rijndael192, Rijndael256, Twofish,DSA, RSA, and ElGamal)
"Only Bad Coders Code Badly In Perl" (OBC2BIP)
| [reply] |
MD5 is ireversible. means you cant decrypt, as its only used to encrypt a string to hide it from anyones eyes, eg. entries in a passwd file.
But you might want to look at CPAN to find a module that fits most your needs. Crypt::Blowfish is quite common in use. Or even use perlmonks search function for "crypt".
Have a nice day
All decision is left to your taste | [reply] |
These documents are stored in database without encryption and anyone with access to server could read it!
I don't know what degree of access have those guys you don't want to access your data. But you should understand that if they can gain access to your secret keys than they can gain access to your documents anyway.
Probably I'm making possibly wrong assumption that your code which decrypts documents will run on same server.
If it is so then I'll ask just a couple of questions. Where are your secret keys going to be stored? On same server? If it is going to be entered each time documents are being decrypted will those bad guys be able to modify your scripts to steal your secret keys?
--
Ilya Martynov
(http://martynov.org/)
| [reply] |