http://qs1969.pair.com?node_id=139481

Alex the Serb has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on big important text encryption with MD5 or something else?

Replies are listed 'Best First'.
Re: big important text encryption with MD5 or something else?
by arhuman (Vicar) on Jan 17, 2002 at 15:55 UTC
    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)
Re: big important text encryption with MD5 or something else?
by little (Curate) on Jan 17, 2002 at 16:03 UTC
    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
Re: big important text encryption with MD5 or something else?
by IlyaM (Parson) on Jan 17, 2002 at 20:15 UTC
    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/)