home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / sci / crypt / 2912 < prev    next >
Encoding:
Text File  |  1992-08-15  |  7.5 KB  |  183 lines

  1. Newsgroups: sci.crypt
  2. Path: sparky!uunet!cs.utexas.edu!milano!cactus.org!ritter
  3. From: ritter@cactus.org (Terry Ritter)
  4. Subject: Re: Growth of mcrypt due to packets
  5. Message-ID: <1992Aug16.081931.8819@cactus.org>
  6. Summary: Very Preliminary Analysis
  7. Keywords: mcrypt
  8. Organization: Capital Area Central Texas UNIX Society, Austin, Tx
  9. References: <1992Aug15.162947.688@mintaka.lcs.mit.edu>
  10. Date: Sun, 16 Aug 1992 08:19:31 GMT
  11. Lines: 170
  12.  
  13.  
  14.  
  15.  In <1992Aug13.153842.24060@mintaka.lcs.mit.edu>
  16.  knight@hal.gnu.ai.mit.edu (Knight of Tossing and Turning) says:
  17.  
  18. >This is the post to the creation method of the "Encryption Grid" of
  19. >"Mass Encryption" aka mcrypt.
  20.  
  21.  
  22. >The most blunt but valid example of this would be
  23.  
  24. >(4x4 matrix, password "china")
  25.  
  26. >   1  2  3  4
  27. >1  C  H  I  N
  28. >2  A  *
  29. >3
  30. >4
  31.  
  32. >  Where * is a NON-ASCII value, computed by third letter of the
  33. >password + 128 ($80).
  34.  
  35.  I'm afraid that I do not understand this fully.  Mass Encryption was
  36.  earlier supposed to be a byte Simple Substitution followed by
  37.  bit-transposition on a 1K block:
  38.  
  39.  
  40.     From <1992Aug11.001118.28760@mintaka.lcs.mit.edu>:
  41.  
  42.    >     The incoming packet is then reassigned bytes.  The key to this
  43.    >is generated off of the password line.
  44.  
  45.    >     The Key Grid is then used as a template to place bits from the
  46.    >incoming data packet into the encrypted packet.
  47.  
  48.  
  49.  How does the User Key create the *two* necessary permutations?
  50.  Or does the cipher simply re-use the *same* permutation for *both*
  51.  the substitution and transposition stages?  But how can this be?
  52.  The Simple Substitution on bytes needs 256 entries of 0..255; a
  53.  complete bit-permutation for a 1K block needs 8192 entries of
  54.  0..8191.
  55.  
  56.  I assume that the matrix structure in the example is used to
  57.  illustrate the transposition permutation (although I would normally
  58.  expect to see a permutation defined in terms of a linear array).
  59.  But there is something very strange about the size of this matrix:
  60.  
  61. >   For password string "X", and distribution of "X" in a 32 * 32
  62. >   matrix is represented by the function GENKEY, . . .
  63.  
  64.  If we are to have a 1024-byte-block and bit-transposition, we will
  65.  need to separately position 8192 bit entries.  A 32 * 32 matrix can
  66.  only hold 1024 entries; thus it can only hold enough data to transpose
  67.  the *bytes* of a 1K block, not *bits* (and that takes two-byte values).
  68.  But the substitution step needs only 256 entries.
  69.  
  70.  
  71.  (MUCH LATER)
  72.  
  73.  OK, I think I see how the process works now:
  74.  
  75.  First we work on the 1's in the "reference grid"; we scan until we
  76.  find the next 1.  Then we place the next input bit at that position
  77.  (presumably in a different storage area, because we will have to
  78.  scan the reference grid again for the next block).
  79.  
  80.  This continues until we are out of 1's in the "reference grid"; then
  81.  we scan for 0's.
  82.  
  83.  This means that "255's" (ff hex) and "0's" may well place a full byte
  84.  of data together, which is why there was some discussion of deleting
  85.  255's and 0's from the reference grid.
  86.  
  87.  It also means that adjacent bits in the input stream are about
  88.  50% likely to be adjacent when enciphered; 25% likely to be separated
  89.  by one bit; 12.5% likely to be separated by two bits, etc.  This
  90.  is in no sense a general permutation; it is better described as
  91.  key-controlled multiplexing or "braiding" (to recall the discussion
  92.  we had last year) without either the random control or the noise data
  93.  channel.
  94.  
  95.  Multiplexer combiners were first openly described by Geffe [1] in
  96.  1973 (where they were used to mix LFSR sequences).  Breaking the
  97.  sequences produced by these combiners is the whole point of the
  98.  Siegenthaler "correlation attack" [2] and now other correlation
  99.  attacks as well.  Although these have always attacked LFSR combiners,
  100.  I have no doubt that the principles can be applied to data combiners,
  101.  perhaps even with improved results.
  102.  
  103.  In this cipher, a particular bit in the plaintext block is not
  104.  positioned arbitrarily in the ciphertext block.  Instead, each bit is
  105.  closely related to its original neighbors.  On average, any particular
  106.  bit has one of its plaintext neighbors next to it in the ciphertext.
  107.  On average, 16 bits of ciphertext contain two intermixed 8-bit
  108.  sequences; take 32 bits of ciphertext and you are sure to get a couple
  109.  of complete plaintext characters.  In other words, the diffusion is
  110.  very weak, and diffusion is all that transposition does.
  111.  
  112.  Moreover, the input data separations (gaps between the runs) are
  113.  not random, indeed, they *make sense* in the underlying reference
  114.  grid; they are, in fact, ASCII letter bit positions.  Known-plaintext
  115.  (after any substitution) may well recover these letters, and thus the
  116.  actual User Key itself.  Any phrase-like structure in the User Key
  117.  will help to fill in gaps in the cryptanalysis.
  118.  
  119.  One remaining issue is how strong the Simple Substitution is at
  120.  preventing the information necessary for attack.  Usually Simple
  121.  Substitution is considered very weak, and it will be much weaker
  122.  if the same "reference grid" is used for both substitution and
  123.  mixing.  Apparently the substitution step was not displayed in the
  124.  "debug mode" output, so it is hard to know how this is done.
  125.  
  126.  
  127. >  The rest of the grid can be generated from happenstance values
  128. >from manipulation of characters from the password characters that
  129. >make up X.  A few formulas would be:
  130.  
  131. >   matrix[x,y]=( ( 1 / ordinal ( X[current])) * 1000) % 256
  132. >   matrix[x,y]=(pi * 10^ordinal(x) ) % 256
  133. >   matrix[x,y]=(X[current-1]^(e*(1/current-2)*(X[current%length(X)])) % 256
  134.  
  135.  These formulas simply to expand the User Key.  They do not produce
  136.  independent results; the results are completely defined by the
  137.  User Key.  Thus, the maximum possible uniqueness is the size of the
  138.  User Key alphabet (95) to the power of the size of the User Key
  139.  string (1024), or 95^1024.  Of course, since only 1024 bits are
  140.  used to encipher a block, there can be no more than 2^1024
  141.  possibilities.  Still huge, to be sure, but note the difference
  142.  from the claim:
  143.  
  144. >   Total permutations for the GENKEY() function = 95 ^ (1024!).
  145.  
  146.  Few users will have a 1024-character User Key, so the average
  147.  uniqueness will be much lower.  The multiplexing will not be
  148.  well-distributed or random, because a User Key of any size will
  149.  probably be a language phrase, and that plaintext phrase will control
  150.  the multiplexer directly.  The expansion formulas may well be used to
  151.  expand any cryptanalytic "breaks" to multiple places within the block.
  152.  The expansion formulas themselves may relate individual User Key
  153.  characters to multiple locations in the block, yielding multiple
  154.  attack possibilities (it may be possible to attack individual User
  155.  Key characters this way).  For icing on the cake, the plaintext User
  156.  Key itself will exist in a known position the "reference grid," just
  157.  begging to be the first thing attacked.  And this is not to mention
  158.  anagramming, the classical attack on transposition.
  159.  
  160.  But the real problem is that the underlying multiplexing step
  161.  is so very weak.
  162.  
  163.  One might argue that the multiplexing still provides 2^1024 options
  164.  for the data block (although I argue that correlation effects greatly
  165.  reduce this value).  But few would disagree that each additional
  166.  block enciphered in the same way would greatly improve the ability
  167.  to attack the cipher.
  168.  
  169.  
  170.  References
  171.  
  172.  [1]  Geffe, P.  1973.  How to protect data with ciphers that are
  173.       really hard to break.  Electronics.  January 4.  99-101.
  174.  
  175.  [2]  Siegenthaler, T.  1985.  Decrypting a Class of Stream Ciphers
  176.       Using Ciphertext Only.  IEEE Transactions on Computers.
  177.       C34: 81-85.
  178.  
  179.  ---
  180.  Terry Ritter   ritter@cactus.org
  181.  
  182.  
  183.