thraxil wrote:

if the key is longer than the message being encrypted and the key is perfectly random, it is provably unbreakable (it's just a one-time pad).

This is true if used as a one-time pad: one-time. In the original post, I got the impression that this encryption is to be used many times, thus falling prey to your second caveat: the key being shorter than the message makes the message insecure. In this case, the cracker can just concatenate the messages (well, it's often more complex than that, but you get the idea).

If, however, there were some form of key exchange like the Diffie-Hellman method, then a secure, random key can be distributed, but that seems to take us back to the original problem of creating security because you have to settle on a method of encrypting the random key and you can't just use it to XOR itself :) If you encrypt the random key, you may as well just encrypt the original data.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to Re: Re: How secure is XOR encryption? by Ovid
in thread How secure is XOR encryption? by talexb

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.