Cryptography: Difference between revisions
From charlesreid1
(Created page with "Notes on crypto stuff. PyOTP: https://labix.org/python-otp") |
No edit summary |
||
| Line 2: | Line 2: | ||
PyOTP: https://labix.org/python-otp | PyOTP: https://labix.org/python-otp | ||
ROT and other replacement ciphers: | |||
<pre> | |||
import string | |||
rot13 = string.maketrans( | |||
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz", | |||
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm") | |||
string.translate("Hello World!", rot13) | |||
# 'Uryyb Jbeyq!' | |||
</pre> | |||
Revision as of 01:02, 26 August 2016
Notes on crypto stuff.
PyOTP: https://labix.org/python-otp
ROT and other replacement ciphers:
import string
rot13 = string.maketrans(
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz",
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm")
string.translate("Hello World!", rot13)
# 'Uryyb Jbeyq!'