Re: Is storing MD5 hash of key with ciphertext safe?

From: Paul Rubin (//phr.cx_at_NOSPAM.invalid)
Date: 12/23/03


Date: 23 Dec 2003 12:59:22 -0800

brett <brett@eecs.tufts.edu> writes:
> Ive got a text file im storing in a mySql database encrypted with Rijndael
> 128 in CFB mode. The key (and also the initialization vector) is the md5
> hash of a plain text passphrase.

Don't use the key as an IV. Generate a random IV and store it.

Don't store the hashed key. Use the passphrase to generate a MAC key
(separate from the encryption key) and MAC the plaintext and store the MAC.

Example:

    encryption_key = md5("encrypt:" + passphrase)
    auth_key = md5("auth:" + passphrase)

and use these two keys to encrypt and MAC the file. You can also use
a combined encryption+MAC mode. Do not operate without a MAC.



Relevant Pages

  • Re: Hash question ...
    ... header of the file. ... When a user enters an incorrect passphrase, ... if I generate an encryption key with the ... could I safely store the SHA of the passphrase ...
    (sci.crypt)
  • Re: Connecting a G4 powerbook to a DLink router
    ... >> With encryption, you have to use the key, not the ... > So I can use an easy to remember passphrase or type in a giberish key? ... The Mac never fails to connect to hot-spots the world over. ... George Graves ...
    (comp.sys.mac.advocacy)
  • Re: On the Recent PGP and Truecrypt Posting
    ... changing the passphrase would lock out prior users. ... Clearly a users with a backup copy of an encrypted disk for which they ... clear that real world users actually understand the need to re-encrypt ... You will also also see the architecture extend to some *very* cool storage encryption very soon. ...
    (Bugtraq)
  • Re: enc and auth scheme with tiny cryptograms
    ... - the size of the cryptograms must be minimized ... I will use different keys for encryption and the MAC (can someone ... is some block cipher like AES or Twofish in OFB mode and MAC is UMAC. ...
    (sci.crypt)
  • Re: needed: reviewers for an implementaion of AES
    ... This passphrase becomes the default ... encryption key, but is used to generate a 256 bit encryption key called ... encrypted with any file key which uses this master key structure. ... using the master key IV and CBC block chaining. ...
    (sci.crypt)

Quantcast