Suppose I want to encrypt a file locally, put it on the internet, and be able to grab it later. I want to make sure that only people with a certain password/phrase can decrypt the file ... and I insist on incorporating a one-time-pad.
Assuming it's only used to encrypt a message once, if one were to use a very random passphrase (e.g. Diceware) to seed the pad in a reproducible way, would this be a problem? In python, I would do something like random.seed("hurt coaster lemon swab lincoln")
and then generate my pad. I would use the same seed for encryption and decryption.
I am reading warnings all over the place about how this Mersenne Twister RNG is not suitable for security/cryptography purposes, so I'm cautious. I see that it has a very long period, and IIUC, that random.seed
allows me to choose 16 bytes worth of different seeds (Python: where is random.random() seeded?).
I've heard that the numbers in an OTP should be "truly random", but even if somebody saw, say, the 1st 100 characters of my pad, how much would that help them in determining what the seed of my RNG was (in hopes of decoding the rest)? I suppose they could brute force the seed by generating pads from every possible random seed and seeing which ones match my first 100 random letters. Still, there are quite a few random seeds to try, right?
So, is this safe? And is there a reasonable way to figure out the seed of a sequence generated by common RNGs by peeking at a little bit of the sequence? I know file encryption is a "solved problem", but a discussion of any pitfalls here would be educational for me.
Aucun commentaire:
Enregistrer un commentaire