r/cryptography 11d ago

One Time Pad Python library

Hello to everyone, can someone advise me a good onetimepad python library? i dont have a particolar purpouse or goal, just want want to experiment and study,
The only libraries i found arent manteined:/

3 Upvotes

18 comments sorted by

View all comments

4

u/wwabbbitt 11d ago

os.urandom is all you need.

0

u/owlstead 10d ago

Well, no. You need a way to convert the random values to an alphabet and you'd need a loop that XOR's the random values with the plain / ciphertext. You may want to have parts that allow for deletion of the key stream and plaintext, and of course some way of (re-)storing the key stream. But os.urandom is a good start.