home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / sci / crypt / 6505 < prev    next >
Encoding:
Text File  |  1993-01-07  |  4.0 KB  |  102 lines

  1. Newsgroups: sci.crypt
  2. Path: sparky!uunet!walter!thumper!milton
  3. From: milton@thumper..bellcore.com (Milton Anderson)
  4. Subject: simple crypto algorithm descriptions
  5. Message-ID: <1993Jan7.234910.27459@walter.bellcore.com>
  6. Sender: news@walter.bellcore.com
  7. Nntp-Posting-Host: thumper.bellcore.com
  8. Reply-To: milton@thumper.UUCP (Milton Anderson)
  9. Organization: Bellcore MRE
  10. Date: Thu, 7 Jan 93 23:49:10 GMT
  11. Lines: 89
  12.  
  13. To provoke some technical discussion, an interesting question 
  14. might be -- What is the simplest effective cryptological algorithm,
  15. i.e. the one that can be described using the fewest high-level 
  16. programming language operators?
  17.  
  18. In order to make the algorithm simple to describe, we can
  19. trade off some other characteristics, e.g.:
  20.     - key length (anything under 10kB is OK, given current
  21.       media densities),
  22.     - executable size (up to a few MBs),
  23.     - execution speed (up to about 10 k instructions per
  24.       byte on a 100 MIPS processor is OK)
  25.  
  26. As an illustrative example, consider the following description 
  27. using C-language operators.
  28.  
  29. First define:
  30. 1    union { double f[63]   int i[127]   } x  
  31. 2    int j, k
  32. 3    int m, mp, c, r  
  33.  
  34. Then for each bit of the message:
  35. 4        x.i[k] = x.i[k] ^ (mp << 31)
  36. 5        x.i[k] = x.i[k] ^ (r  << 15)  
  37. 6        x.f[j] = 4.0 * x.f[j] * ( 1.0 - x.f[j] )  
  38. 7              c = m ^ ((x.i[k] >> 23) & 1)
  39. 8        mp = m    
  40. 9         r = (x.i[k] >> 19) & 1
  41. 10        j = (x.i[k] >> 15) & 0x3f
  42. 11        k = j * 2 + 1  
  43.  
  44. To decrypt each bit of the message replace (8) by:
  45. 8              m = c ^ ((x.i[k] >> 23 ) & 1)
  46.  
  47.  
  48. The key is the 64 initial values of the floating point
  49. variables x.f defined in (1).  Initially j, mp and r are
  50. zero, and k is one, although they could be used as key bits.  
  51. For each bit encrypted, one of the ensemble of 64 chaotic systems is
  52. iterated once in (6).  The 24th lsb of the mantissa is extracted
  53. from the state variable and used in a Vernam cipher in (7)
  54. where the crypto bit c is computed from the message bit m.
  55. The message bit m is saved as mp in (8) and used in (4) for
  56. message feedback in the next iteration to ensure that the
  57. pseudorandom bits used in the Vernam cipher depend on the
  58. message content.  A pseudorandom bit r is extracted in (9) and
  59. then used in (5) to provide coupling between the chaotic
  60. systems, which are iterated in a psuedorandom order according
  61. to (10) and (11).    
  62.  
  63. Beware the endianness of your machine; the above is for a Sun,
  64. and you may need to make (11) k = j * 2 instead.  Also note
  65. that different fpus give different results -- the limit cycle
  66. of one system is about 5 M iterations on a Sun 4 and about 15
  67. M on a PC with 287.  How your system initializes the fpu control word
  68. for round-off may also matter.  Therefore this algorithm would
  69. be mostly useful for keeping your private files private -- or
  70. between machines with compatible hardware.  
  71.  
  72. Note that a rather large family of algorithms can be
  73. constructed by varying the bit position and functional form of
  74. the message perturbation, the coupling perturbation and the
  75. sequence calculation.  For more variety use:
  76. 6        x.f[j] = g[j] * x.f[j] * ( 1.0 - x.f[j] )  
  77. 7        while (x.f[j] > 1.0)  x.f[j] -= 1.0
  78. where g[] is an array of floating point numbers in the
  79. interval (0.0, 8.0].  The number of chaotic systems may be
  80. adjusted as well, and if the dimension of the arrays requires,
  81. the x.f[] and g[] may be initialized by use of a function of
  82. fewer variables.  E.g. the x.f could be calculated using a
  83. sine function of a key consisting of amplitude, initial phase
  84. and phase increment.
  85.  
  86. If anyone has a R4000 or Alpha, I'd appreciate knowing the
  87. limit cycle and execution speed of the assembly language equivalent of:
  88.     x = (x * (x ^ 0xffffffffffffffff)) >> 61
  89. i.e. the radix-63 implementation of the chaotic system using
  90. 64-bit integers with a 128-bit product.  I'm assuming the
  91. C-compiler won't handle this yet?  But when it does then
  92. fixed-point implementations which are compatible between
  93. differing machines would be simple as well.
  94.  
  95. The use of chaotic systems as PRNGs has been described in
  96. Cryptologia.  
  97.  
  98. Milton Anderson
  99. milton@thumper.bellcore.com
  100.  
  101.  
  102.