home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / sci / crypt / 2937 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  14.7 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!yale.edu!yale!mintaka.lcs.mit.edu!hal.gnu.ai.mit.edu!knight
  2. From: knight@hal.gnu.ai.mit.edu (Knight of Tossing and Turning)
  3. Newsgroups: sci.crypt
  4. Subject: mcrypt again
  5. Message-ID: <1992Aug18.233021.15859@mintaka.lcs.mit.edu>
  6. Date: 18 Aug 92 23:30:21 GMT
  7. Sender: news@mintaka.lcs.mit.edu
  8. Organization: MIT Laboratory for Computer Science
  9. Lines: 300
  10.  
  11.  
  12.  In <1992Aug13.153842.24060@mintaka.lcs.mit.edu>
  13.  knight@hal.gnu.ai.mit.edu (Knight of Tossing and Turning) says:
  14.  
  15. >>This is the post to the creation method of the "Encryption Grid" of
  16. >>"Mass Encryption" aka mcrypt.
  17. >>  example deleted
  18.  
  19. > I'm afraid that I do not understand this fully.  Mass Encryption was
  20. > earlier supposed to be a byte Simple Substitution followed by
  21. > bit-transposition on a 1K block:
  22.  
  23. >> ...stuff deleted
  24.  
  25. > How does the User Key create the *two* necessary permutations?
  26. > Or does the cipher simply re-use the *same* permutation for *both*
  27. > the substitution and transposition stages?  But how can this be?
  28. > The Simple Substitution on bytes needs 256 entries of 0..255; a
  29. > complete bit-permutation for a 1K block needs 8192 entries of
  30. > 0..8191.
  31.  
  32. As I explained earlier, I figured everyone knew what a simple
  33. substitution looked like, so I wouldn't waste time with it.  Basically,
  34. I was going to use a program which is basically the algorythm used
  35. for shuffling decks of cards in Video Poker programs, just using some
  36. elements of the password line to generate them.  I figured that this
  37. method would be safe as long as I didn't generate the bit transposition
  38. phase and the simple-substitution phase the exact same way or in some
  39. way directly linked outside of the password field.  In other words, bits
  40. are used in the transposition phase, and integers and positioning are
  41. used in the simple-substitution phase.  Therefore, not directly linked by
  42. anything but the password.
  43.  
  44. >>   For password string "X", and distribution of "X" in a 32 * 32
  45. >>   matrix is represented by the function GENKEY, . . .
  46.  
  47. > OK, I think I see how the process works now:
  48. > ... accurate stuff deleted
  49.  
  50. > It also means that adjacent bits in the input stream are about
  51. > 50% likely to be adjacent when enciphered; 25% likely to be separated
  52. > by one bit; 12.5% likely to be separated by two bits, etc.  This
  53. > is in no sense a general permutation; it is better described as
  54. > key-controlled multiplexing or "braiding" (to recall the discussion
  55. > we had last year) without either the random control or the noise data
  56. > channel.
  57.  
  58. Your right, I had this problem proving my system earlier.  I wrote
  59. a program which took into consideration the rules which I generated
  60. and came up with a number in the whereabouts of 2^54.  Since then,
  61. I've been debating if I should remove the required 0<x<255 rule.
  62. Removal of this would cause the permutations to jump dramatically.
  63.  
  64. If you are off by a single bit, the entire encryption will likely be
  65. ruined and the simple substitution will cause a 1-in-256 chance of 
  66. anything you've generated being accurate at all.  It is basically
  67. a deck of cards -- pull out the wrong bit and the whole scheme will
  68. collapse.   
  69.  
  70. I wrote a program to solve for this series of numbers, I posted the
  71. results of the program to sci.crypt several days back.
  72.  
  73.  >  On average, 16 bits of ciphertext contain two intermixed 8-bit
  74.  >  sequences; take 32 bits of ciphertext and you are sure to get a couple
  75.  >  of complete plaintext characters.  In other words, the diffusion is
  76.  >  very weak, and diffusion is all that transposition does.
  77.  
  78. Okay, lets get more to the heart of what you really were trying to 
  79. point out -- and that was the arrangement must be stream-like, and
  80. therefore has a fairly finite method of extraction from 32 bits.
  81.  
  82. First of all, lets say you extract 3 bytes of data from 32 bits of
  83. ciphertext.  First of all, some of that data will be sequential to 
  84. your needs.  That is -- in order of extraction.  However, some of that
  85. plaintext will be out of order -- after inverse takes place.  Therefore,
  86. bytes 1, 2, and 3 could be mixed with bytes 678, 679, and 680.  This
  87. is severely "out of phase" since you haven't even determined what bytes
  88. 4-677 are supposed to be yet.
  89.  
  90. To repeatitively "take guesses" would be 95*95 (if in password field)
  91. or 10,355 ways to extract the very first BYTE, the first piece of 
  92. pseudo-plaintext, and THAT could be one of 256 values, because of the
  93. simple-substitution made earlier.  Therefore, the ultimate chances of
  94. extracting the very first byte, in accordance to the "system" which
  95. will extract all additional bytes accurately, is 1 in 2,650,880!  And
  96. then you will have to guess the NEXT byte so that it follows the exact
  97. same parameters, which cannot be derrived from the first byte. 
  98.  
  99. Yes, I realize that there are only 256 possible numbers for the first
  100. byte, but this the encryption is highly structured.  To take the first
  101. byte that "matches" will doubtless prevent the extraction of any other
  102. byte accurately -- you'd be "making it up" as you go along.        
  103.  
  104. > Moreover, the input data separations (gaps between the runs) are
  105. > not random, indeed, they *make sense* in the underlying reference
  106. > grid; they are, in fact, ASCII letter bit positions.  Known-plaintext
  107. > (after any substitution) may well recover these letters, and thus the
  108. > actual User Key itself.  Any phrase-like structure in the User Key
  109. > will help to fill in gaps in the cryptanalysis.
  110.  
  111. Yes, but this is basically true of any encryption.  However, this
  112. isn't ALWAYS true.  Hence:
  113.  
  114.     1  2  3  4
  115.   1 C  H  I  N
  116.   2 A  *
  117.   3
  118.   4
  119.  
  120. The "*" was a distinct, NON-ASCII character.  Therefore, to assume you
  121. can treat any series at all as only ASCII bit positions, you would have
  122. the problem dealing with the length of the password itself.
  123.  
  124. And how well do they make sense?  Lets take the following pattern that
  125. I will agree to:  for the first 6 digits (assuming a 6 digit minimum)
  126. the high (7) bit will be always "0".  After digit 6, the number could
  127. be ASCII or the NON-ASCII value (190 possibilities).  After that, it
  128. could be hashed to a number as high as 254 or as low as 1.  So the
  129. "pattern" permutations jump right where most people start placing a
  130. password!  You'd need as few as 7 digits to watch it climb past the 
  131. "ascii" assumption.  By lowering the number of digits "necessary" in
  132. my program, it causes the permutations to jump all the sooner.  It
  133. would be maximized by a single letter password.  
  134.  
  135. >  One remaining issue is how strong the Simple Substitution is at
  136. >  preventing the information necessary for attack.  Usually Simple
  137. >  Substitution is considered very weak, and it will be much weaker
  138. >  if the same "reference grid" is used for both substitution and
  139. >  mixing.  Apparently the substitution step was not displayed in the
  140. >  "debug mode" output, so it is hard to know how this is done.
  141.  
  142. Sorry, this step wasn't even in my program when I originally placed
  143. was requested to show my idea to "sci.crypt".  I'll have this placed
  144. for all to view (and my source code) probably within the week, provided
  145. my relatives ever leave the house (and my telephone ever starts working
  146. right for a consistant period of time.)
  147.  
  148. Even though simple substitution is weak, it was included for two
  149. basic reasons:
  150.  
  151.   1)  It adds doubt to anything removed out of the "bit transposition"
  152.       phase (eliminating the bulk of the plaintext prior to the really
  153.       tough(?) encryption.)  Unless you have the real password, you
  154.       will have to guess as to the result of this step will be.
  155.  
  156.   2)  It prevents the argument that if the encrypted file has the same
  157.       number of bits as the unencrypted file, and the two files were
  158.       of large enough proportions, they were the same file.
  159.  
  160. >>  The rest of the grid can be generated from happenstance values
  161. >>from manipulation of characters from the password characters that
  162. >>make up X.  A few formulas would be:
  163. >> .. pointless hash functions deleted.
  164.  
  165. > These formulas simply to expand the User Key.  They do not produce
  166. > independent results; the results are completely defined by the
  167. > User Key.  Thus, the maximum possible uniqueness is the size of the
  168. > User Key alphabet (95) to the power of the size of the User Key
  169. > string (1024), or 95^1024.  Of course, since only 1024 bits are
  170. > used to encipher a block, there can be no more than 2^1024
  171. > possibilities.  Still huge, to be sure, but note the difference
  172. > from the claim:
  173.  
  174. >>   Total permutations for the GENKEY() function = 95 ^ (1024!).
  175.  
  176. +  Deleted 2^1024 vs 2^8192 harp, since everyone attacked it already. 
  177.  
  178. Also, my claim of 95^1024! is due to the fact that length is provided
  179. in the password "key grid" by placing of the non-ascii value.  Therefore,
  180. for each limited length string between 1 and 1024 characters long, there
  181. exists a unique key grid -- which is reminicant of a factorial value.
  182. Admittably, I wish I had some computer to tell me which of the two numbers
  183. is smaller, but I can generate the factorial value inside of the 2^8192
  184. grid, but only because I "trick" the "1024" position into not having to
  185. supply me with a length.  (Hence, if all 1024 bytes are ascii, then I
  186. don't have to place a non-ascii value to tell me the length.)  
  187.  
  188. Looks to me as if my claim still holds valid.
  189.  
  190. > Few users will have a 1024-character User Key, so the average
  191. > uniqueness will be much lower.  The multiplexing will not be
  192. > well-distributed or random, because a User Key of any size will
  193. > probably be a language phrase, and that plaintext phrase will control
  194. > the multiplexer directly.  The expansion formulas may well be used to
  195. > expand any cryptanalytic "breaks" to multiple places within the block.
  196. > The expansion formulas themselves may relate individual User Key
  197. > characters to multiple locations in the block, yielding multiple
  198. > attack possibilities (it may be possible to attack individual User
  199. > Key characters this way).  For icing on the cake, the plaintext User
  200. > Key itself will exist in a known position the "reference grid," just
  201. > begging to be the first thing attacked.  And this is not to mention
  202. > anagramming, the classical attack on transposition.
  203.  
  204. A-HA!  Great points!  Let me see if I can defend against this:
  205.  
  206. 1) Like all 'password' based encryptions, attacks against language
  207. phrases by using phonics can be used to reduce the total number of
  208. "attempts" required IF the word is indeed a word.  Furthermore,
  209. the "BUG" story comes into effect as far as people using really
  210. small passwords, as many people prefer to do that.
  211.  
  212. To quote Helen Gaines's book "Cryptanalysis", p3:
  213.  
  214.   "Even a basically weak cipher, in the hands of an expert, can be
  215.    made to serve its purpose; and the strongest can be made useless
  216.    when inproperly used."
  217.  
  218. 2)  Okay, admittably everything along the line is basically a
  219.     series starting with 95 ways times several possibilties that are
  220.     approximately 95 ways until reaching value 1024.  But this is
  221.     the limiting factor, which is still a huge number.  Even a six
  222.     digit password would be 95*95*95*95*95*95, or 95^6, which is
  223.     basically 735,091,890,625 possibilities.  That may look fairly
  224.     weak, but if your not sure about the length of the password, the
  225.     7 digit possibilities- 69833729609375 and the 8 digit possibilties
  226.     - 6634204312840625, are basically enough to make "standard"
  227.     brute force unfeasable against those attempts. 
  228.  
  229.     DES encryption has the problem that two strings could generate
  230.     the same result.  I believe this also holds true with RSA
  231.     due to the relatively small number of permutations compared to
  232.     possible passwords that can be entered.
  233.  
  234. 3)  Attack against the fact the password itself is used in the
  235.     "key" grid.  Lets consider the following bits were placed using
  236.     mcrypt, and that these bits represent the area of the "grid"
  237.     where the password (in ASCII format) was used to generate the
  238.     positioning of these bits, find the password:
  239.  
  240.                                 POSITION
  241.  
  242.      byte 1   byte 2   byte 3   byte 4   byte 5   byte 6   byte 7
  243.     01234567 01234567 01234567 01234567 01234567 01234567 01234567
  244.  
  245. D:  01001011 11011011 11011001 00100110 11001000 11101110 10100001
  246.  
  247. D = Encrypted data.
  248.  
  249. Starting from scratch, not knowing what the data inside contains,
  250. knowing it could very well have been compressed prior to
  251. encryption, knowing that the values of the bytes have been altered
  252. prior to bit transposition, how do you extract the password
  253. using nothing but that data?  If the data could be anything,
  254. then the password itself likewise could be anything.  How long
  255. is the password?  Is it 6 digits?  Is it 7 digits?  Is it larger
  256. then the segment I removed?  I took VERY careful consideration to
  257. make sure that "clues" to the password never made it into the
  258. encrypted file.
  259.  
  260. I didn't think that using the ascii characters themselves
  261. in the encryption grid is a problem.  Sure, it looks vulernable when
  262. you stare at them on paper, but after the file is encrypted, the 
  263. entire thing is discarded completely.  I figured it was the opposite,
  264. a STRENGTH to the encryption.  That way, no matter what, I was
  265. guarenteed the maximum number of keys generatable by ASCII.
  266.  
  267. > But the real problem is that the underlying multiplexing step
  268. > is so very weak.
  269.  
  270. An eight digit password has 6,634,204,312,840,625 possible arrangements
  271. of bits.  This doesn't include passwords of earlier length.  If you 
  272. mess up but a single BIT anywhere in that combination, the rest of the
  273. encryption will fall apart and you will unlikely be able to generate 
  274. any provable plaintext from the entire system (due to the simple
  275. substitution.)          
  276.  
  277. > One might argue that the multiplexing still provides 2^[8192] options
  278. > for the data block (although I argue that correlation effects greatly
  279. > reduce this value).  But few would disagree that each additional
  280. > block enciphered in the same way would greatly improve the ability
  281. > to attack the cipher.
  282.  
  283. Every "additional" block encrypted will cause extensive damage to the
  284. I/O usage and DRAM required to analyze the encryption.  I'm not sure
  285. if you are aware of what components of the computer are slower and faster
  286. then others, but the more you rely on disk drive seeks and calls to
  287. stored data in Dynamic Memory, the less likely your program has a chance
  288. to ever finish.  More calls to the operating system to handle that, the
  289. more slowdown you will receive, also.  "Hardware" protected?  Maybe. 
  290.  
  291. This brings about a point not covered recently, and that is the lack of
  292. a "verification" system.  Basically, Mcrypt has no way of telling
  293. if the data was properly extracted.  You will have to create your own
  294. methods, which adds considerable amounts of time. 
  295.  
  296. > References
  297. >
  298. > [1]  Geffe, P.  1973.  How to protect data with ciphers that are
  299. >      really hard to break.  Electronics.  January 4.  99-101.
  300. >
  301. > [2]  Siegenthaler, T.  1985.  Decrypting a Class of Stream Ciphers
  302. >      Using Ciphertext Only.  IEEE Transactions on Computers.
  303. >      C34: 81-85.
  304.  
  305. Will try to get, thank you.
  306.  
  307. > ---
  308. > Terry Ritter   ritter@cactus.org
  309.  
  310. --- Eric Knight, knight@gnu.ai.mit.edu
  311.