home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / sci / crypt / 6356 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  1.9 KB

  1. Xref: sparky sci.crypt:6356 alt.security.pgp:452
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!kth.se!news.kth.se!juha
  3. From: juha@elixir.e.kth.se (Juha Sarlin)
  4. Newsgroups: sci.crypt,alt.security.pgp
  5. Subject: PGP 2.1 doesn't use first byte of IDEA random key?
  6. Message-ID: <JUHA.93Jan4174657@elixir.elixir.e.kth.se>
  7. Date: 4 Jan 93 16:46:57 GMT
  8. Sender: usenet@kth.se (Usenet)
  9. Organization: School of EE, Royal Institute of Technology, Sweden
  10. Lines: 43
  11. Nntp-Posting-Host: elixir.e.kth.se
  12.  
  13. The function strong_pseudorandom() uses a key and a seed from the
  14. randseed.bin file to generate pseudo-random numbers.  For some reason
  15. the first byte of the key is not initialized or modified, although I
  16. think that it is used in key generation.  Perhaps the author hoped to
  17. get random data in the buffers because they are on the stack?  On my
  18. system the first byte seems to always be zero.
  19.  
  20. Here is a patch to handle the first byte in same way as all the
  21. others:
  22.  
  23. *** 1.1    1992/12/27 15:37:03
  24. --- crypto.c    1993/01/04 15:24:41
  25. ***************
  26. *** 327,329 ****
  27.           randaccum(8*(sizeof(key)+sizeof(seed)));
  28. !         for (i=1; i<sizeof(key); i++)
  29.               key[i] ^= randombyte();
  30. --- 327,329 ----
  31.           randaccum(8*(sizeof(key)+sizeof(seed)));
  32. !         for (i=0; i<sizeof(key); i++)
  33.               key[i] ^= randombyte();
  34. ***************
  35. *** 360,362 ****
  36.       /* now cover up evidence of what user got */
  37. !     for (i=1; i<sizeof(key); i++)
  38.           key[i] ^= idearand() ^ randombyte();
  39. --- 360,362 ----
  40.       /* now cover up evidence of what user got */
  41. !     for (i=0; i<sizeof(key); i++)
  42.           key[i] ^= idearand() ^ randombyte();
  43. ***************
  44. *** 396,399 ****
  45.       count=0;
  46. !     while (++count <= IDEAKEYSIZE)
  47. !         key[count] = randombyte();
  48.   
  49. --- 396,399 ----
  50.       count=0;
  51. !     while (count < IDEAKEYSIZE)
  52. !         key[count++] = randombyte();
  53.   
  54. --
  55. Juha Sarlin   juha@elixir.e.kth.se or juha@tds.kth.se
  56.