home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / sci / crypt / 6292 < prev    next >
Encoding:
Text File  |  1992-12-30  |  2.1 KB  |  58 lines

  1. Newsgroups: sci.crypt
  2. Path: sparky!uunet!walter!qualcom.qualcomm.com!servo.qualcomm.com!karn
  3. From: karn@servo.qualcomm.com (Phil Karn)
  4. Subject: Re: MD5 as an encryption engine?
  5. Message-ID: <1992Dec30.232732.7075@qualcomm.com>
  6. Sender: news@qualcomm.com
  7. Nntp-Posting-Host: servo.qualcomm.com
  8. Organization: Qualcomm, Inc
  9. References: <TODD.92Dec30124821@palomar.tivoli.com> <1ht56mINNbl3@transfer.stratus.com>
  10. Distribution: sci
  11. Date: Wed, 30 Dec 1992 23:27:32 GMT
  12. Lines: 44
  13.  
  14. In article <1ht56mINNbl3@transfer.stratus.com> cme@ellisun.sw.stratus.com (Carl Ellison) writes:
  15. >It's the code using MD5 or exponentiation which would be the encryption
  16. >code -- not the digest or exponentiation code itself.
  17.  
  18. Which is ironic, of course, considering that all of the cryptographic
  19. strength of the resulting cipher would come from MD5, not the code
  20. that turns it into a cipher. The latter is completely linear, so it
  21. contributes nothing on its own.
  22.  
  23. This topic got discussed here over a year ago. At the time I think we
  24. settled on a DES-inspired, "braided" Feistel structure that looked
  25. like this:
  26.  
  27. Divide plaintext P into two halves, P1 and P2.
  28.  
  29. A = MD5(Key1,P1) XOR P2
  30. C1 = MD5(Key2,A) XOR P1
  31. C2 = MD5(Key3,C1) XOR A
  32.  
  33. Now concatenate to produce ciphertext C = C1,C2.  To decrypt, reverse
  34. the steps:
  35.  
  36. A = MD5(Key3,C1) XOR C2
  37. P1 = MD5(Key2,A) XOR C1
  38. P2 = MD5(Key1,P1) XOR A
  39.  
  40. And P = P1,P2.
  41.  
  42. Note the use of three separate keys, one for each round. This is
  43. important. (I think the formal proofs of this algorithm's security
  44. require this.)  They can be generated from a single key by successive
  45. MD5 hashing, if desired.  Also, the actual complete MD5 function need
  46. not be used here; you could extract its internal "transform" function
  47. and use it instead, as long as you're willing to use its internal
  48. block sizes of 64 bytes in, 16 bytes out. In this case, the subkeys
  49. would each be 48 bytes and P and C would be 32 bytes, which might be a
  50. bit unwieldly for some applications.
  51.  
  52. Also, this algorithm won't be as fast as MD5 used for hashing. A
  53. single turn of the MD5 "crank" crunches 64 bytes of input, but here
  54. the encryption of 32 bytes of data requires three executions of MD5 --
  55. 6 times slower.
  56.  
  57. Phil
  58.