home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / sci / crypt / 2770 < prev    next >
Encoding:
Text File  |  1992-07-29  |  3.2 KB  |  75 lines

  1. Newsgroups: sci.crypt
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!informatik.tu-muenchen.de!zeisset
  3. From: zeisset@Informatik.TU-Muenchen.DE (Stephan Zeisset)
  4. Subject: Re: Cypher algorithm question.
  5. Keywords: question, algorithm, encrypt, crypt, decrypt
  6. References:  <tom.712397505@cluster>
  7. Originator: zeisset@hphalle5j.informatik.tu-muenchen.de
  8. Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
  9. Organization: TU M"unchen (FRG)
  10. Date: Wed, 29 Jul 1992 10:06:09 GMT
  11. Message-ID: <1992Jul29.100609.10456@Informatik.TU-Muenchen.DE>
  12. Lines: 61
  13.  
  14.  
  15. In article <tom.712397505@cluster>, tom@stallion.oz.au (Thomas Essebier) writes:
  16. |> By far not being an expert on cryptology, I would appreciate some 
  17. |> comments on the crypto scheme below. 
  18. |> 
  19. |> Where does it stand in terms of security when compared to transposition 
  20. |> cyphers, DES etc.
  21. |> 
  22. |> My initial thoughts were that other then using a brute force approach,
  23. |> e.g. trying all 2^31 seeds (or so), there is no easy way to deal 
  24. |> with it - but I am probably wrong :-)
  25. |> 
  26. |> I presume that due to its simplicity this sort of crypto approach must
  27. |> be quite well known, its just that in my rather limited explorations of 
  28. |> the field I have not come accros any.
  29. |> 
  30. |> Algorithm:
  31. |> - Create a sequence of random numbers that starts at 'seed' and is known 
  32. |>   to be deterministic and to have a large period. e.g. linear congruential:
  33. |>   X[i+1] = (a*X[i] + c) mod m, choose coefficients as follows 
  34. |>   a = 16807, m = 2,147,483,647 (2^31 - 1), c = 0
  35. |>   #define RANDOM ((unsigned char) (seed = (16807 * seed) % 2147483647))
  36. |>   supposedly has a period of 2^31.
  37. |> 
  38. |> - use the 'key' to choose the first seed, e.g. add up all the bytes or
  39. |>   some such, so that a key >= 4 byte could cover 0-2^31, roughly at least.
  40. |> 
  41. |> - take the the data stream and for each byte 'xor' the LSB of the 'seed'.
  42. |>   A stronger method might be to use 4 byte chunks (assuming seed is 4 bytes)?
  43. |>   The advantage of using xor is that there is that the algorithm is self
  44. |>   reversing. Perhaps it entails some pitfall(s) however?
  45. |> 
  46. |> If anybody could point me to some literature that explains why the above
  47. |> is (un?)reasonably (in?)secure I would be most grateful. Please note that
  48. |> I make no claim to have carefully studied and researched this topic. 
  49. |> I was hoping to avoid all that :-)
  50.  
  51. The problem with your algorithm is with the know plaintext text.
  52. That means, your opponent knows some of the original plaintext or
  53. makes a good guess of it.
  54. For example, if the plaintext is a letter to someone, you
  55. would expect something like 'Dear Mr ...' or anything alike
  56. in the first few lines of the plaintext.
  57. If I know only 4 Bytes of the plaintext and its position 
  58. (must be divideable by 4) I can easily tell the state of
  59. your random generator at this time (= plaintext word
  60. xor ciphertext word) and decode the following ciphertext.
  61.  
  62. You could improve your algorithm by:
  63. - Increasing the # of states of your generator,
  64.   e.g. by using an intermediate array:
  65.     r = RANDOM; 
  66.     num = A[index];
  67.     A[index] = r;
  68.     index = r;
  69.     return(num);
  70. - Backcoupling the plaintext into the state of your random
  71.   generator.
  72.  
  73. Stephan.
  74.  
  75.