It appears you didn't notice, but in the Wiki:One-time Pad article you linked, the second sentence of the second paragraph specifically says, " On July 22, 1919, U.S. Patent 1,310,719 was issued to Gilbert S. Vernam for the XOR operation used for the encryption of a one-time pad.".

First off, this is precisely what tobyink said in Re^2: crypto with core modules only: that one-time pads can be easily implemented with XOR. And you've been arguing against him on this, despite the fact that the article you mentioned points this out, quite early on.

Second, you just mentioned your "modulo solution I suggested based on a 100-year old algorithm", trying to imply that it was somehow better by being older. But I'm pretty sure your implementation isn't a hundred years old. You might argue, "but mine is based on the algorithm". I would argue that so is the XOR solution.. And the XOR solution mentioned in the Wiki article, patented in 1919, has the advantage of (currently) being a 99-year-old implementation of the algorithm, whereas your description was made quite recently.

"if the character is drawn randomly from the printables". Apparently, you don't understand that the key for the XOR (the my $encrypted = $message ^ $key; from tobyink's post) is a string of characters randomly chosen octets (though from the full range of 8-bit characters, rather than the limited quantity of "printable characters" that you suggest).

(regarding the update: if the user makes frequent small changes and re-applies it, then it's no longer a one-time pad; it's a multi-time pad with slight modifications, which does not have the strength of security that a true one-time pad has. But arguing that one-time pad can be misused by being reused has nothoing to do with the arguments of "add and modulo" vs "xor", so I'm not sure why you brought it up.)

To sum up, regarding the XOR implementation: It is still a one-time pad, so the underlying algorithm is as old as yours. It has the same random nature of the key as yours does -- but is slightly better, because it has 256 possible characters (in an 8bit-character string representation), rather than the 96 you've limited yourself to. The XOR is faster: it's one math operation per character, rather than the offset, add, modulo, re-offset that you described.


In reply to Re^6: crypto with core modules only by pryrt
in thread crypto with core modules only by morgon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.