| | | A message encrypted with this system can be broken easily in only 2 ke
+y periods
|
That's not quite true. As you said, having only two key periods of message length means that when you XOR the two encrypted segments together, you are left with the XOR of the two plaintext segments. This is not usually enough information to reconstruct the original plaintext message, unless advanced statistical techniques enter the picture. To see why, consider that:
("case" ^ "hook") eq ("gone" ^ "lark")
This is not an isolated case either, it's just the first I came up with after not more than a few minutes of randomly poking around with XOR.
| | | What if you don't know the key length to start with? Some well-chosen
+shifts and xors expose the redundancy in the N*(N-1) period, allowing
+ it to be attacked with frequency analysis as though it had a length
+of only N+(N-1).
|
I'm not sure what you mean by attacking as though length was N+(N-1). You can reduce a double XOR of lengths N and N-1 to solving for N+(N-1) if you have known plaintext of that length, but I'm not aware of any other attacks that reduce the problem in that way.
To find an unknown key length, however, is trivial. The standard technique for discovering an unknown key length is to try XORing the text against itself shifted at various distances, until you see a spike in the index of coincidence. The lowest common multiple of the spiked distances is then your key length.
I'm not a professional cryptographer either, but I like to play one on perlmonks.com ;-)
MeowChow
s aamecha.s a..a\u$&owag.print
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.