Re:Can you break my home rolled encryption?
by Strilanc on Saturday October 26, 2013 @02:14AM
(#6616568)
Expanding decrypted:
You just xored key[pos_a] into itself so we can eliminate it:
I'm pretty sure you just threw away one word's worth of entropy.
[ Parent
| on HN ]
Re:Can you break my home rolled encryption?
by a1k0n on Saturday October 26, 2013 @09:14AM
(#6617279)
except pos_c might be equal to pos_a or pos_b, and key[pos_c] just got rotated. It's not quite equivalent, I tried it.
Re:Can you break my home rolled encryption?
by fhars on Saturday October 26, 2013 @11:18AM
(#6617636)
During the encryption phase the argument by Strilanc doesn't hold (as in that case decrypted[i] is given as the input and does not contain any key admixture), and it is exactly the case where pos_c equals pos_a that is problematic, as in that case the statement
key[pos_a] ^= key[pos_c] ^ i ^ decrypted[i];
overwites key[pos_a] with the value i ^ plaintext[i]
that doesn't depend on any part of the key at all.
Re:Can you break my home rolled encryption?
by Strilanc on Saturday October 26, 2013 @01:07PM
(#6618142)
You're right, if pos_c = pos_a, the rotation does prevent the cancellation.
But throwing away a word of entropy most of the time is still very serious, and ending up with a different cancellation in the remaining cases is not really promising.