Comment 0 for bug 901058

Revision history for this message
aj00200 (aj00200) wrote :

The OTP encryption module is currently using addition and then modulo division to preform encryption but XOR encryption would be much better since it works at the bit level and it would probably be faster.

XOR can be preformed by PyCrypto (which is probably fast, at least if the faster math stuff is available). Otherwise, the following code probably works but could use some testing.

[chr(ord(p) ^ ord(o)) for plain[i],otp[i] in range(len(plain))]
"".join on above