you should never use one key twice, so maybe this is not a best choice.

Yes, this is a (rather well-known) property of the algorithm, which immediately follows from the underlying XORing used.

However, this doesn't necessarily mean it would be a bad choice, as the 'problem' can easily be worked around using some salting mechanism, which would provide one-time keys, while still allowing the same passphrase to be used multiple times.

For example, just compute the key from the passphrase plus some nonce using a one-way hash function such as MD5. The nonce is stored/transmitted together with the data.  (The RC4 algorithm has a few other more subtle problems, but for the moderate security needs as requested here, they're pretty much irrelevant.)


In reply to Re^3: Fastest Encrypt/Decrypt by almut
in thread Fastest Encrypt/Decrypt by avo

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.