home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / sci / crypt / 4973 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.5 KB  |  40 lines

  1. Newsgroups: sci.crypt
  2. Path: sparky!uunet!destroyer!sol.ctr.columbia.edu!jabba.ess.harris.com!caesun6!mvm
  3. From: mvm@caesun6.epg.harris.com (Matt Mahoney)
  4. Subject: Encryption with MD5
  5. Message-ID: <Bxx8sr.KIH@jabba.ess.harris.com>
  6. Sender: usenet@jabba.ess.harris.com (Usenet News Feed Account)
  7. Nntp-Posting-Host: su3f.ess.harris.com
  8. Reply-To: mvm@epg.harris.com (Matt Mahoney)
  9. Organization: Engineering Productivity Group, Harris Corp., Melbourne, FL
  10. Date: Wed, 18 Nov 1992 17:05:15 GMT
  11. Lines: 27
  12.  
  13. In an earlier article, I asked if encryption by XOR with a pseudo-random
  14. sequence R generated with a secure one-way hash function like MD5:
  15.  
  16.   R[i+1] = MD5(R[i] XOR password)
  17.   ciphertext = plaintext XOR R
  18.  
  19. was secure.  The reponse I got was that it was secure, although not
  20. immune to forgery if part of the plaintext was known.  Also, appending
  21. the password to R[i] instead of XOR might be prefereable.
  22.  
  23. I later discovered a weakness.  If two files encrypted with the same
  24. password are XORed together, then the result is the XOR of the plaintext,
  25. which can be easily broken.
  26.  
  27. One solution would be to use a salt which would be different for
  28. each file, e.g.
  29.  
  30.   salt = MD5(time-of-day + filename + process id + ...)
  31.   R[i+1] = MD5(R[i] + password + salt)
  32.   ciphertext = salt + (plaintext XOR R)
  33.  
  34. where + means concatenation.  Does this weaken the encryption?
  35.  
  36. --------------------------------        _\/_
  37. Matt Mahoney, mvm@epg.harris.com       |(TV)|  Drug of the Nation
  38. #include <disclaimer.h>                |____|
  39.  
  40.