Day 2: Symmetric Encryption
Resources (optional)
- one-time pad: video
Lecture Topics
- notes
- one-time pad
- the two-time pad is insecure
- limitations
- pseudo-random generators
- stream ciphers
Problems
Reminders:
- You can run tests for a function by running
python main.py FUNCTION_NAMEfrom the shell.
We’ll be working in the main.py file. The cryptoy.py library contains
the PRG function, cryptoy.prg(seed, n_bytes) that you’ll use for the stream
cipher.
-
done together:
bytes_to_bitstringbitstring_to_bytes
-
required:
random_bytesxorbitstring_xorone_time_pad_encryptone_time_pad_decryptstream_cipher_encryptstream_cipher_decrypt
-
bonus:
- the “daisy chain” PRG:
prg1daisy_chain_prg
- binary formatting and parsing
int_to_binary,binary_to_int
- cryptanalyzing the many-time pad
many_time_pad_cryptanalysis
- the “daisy chain” PRG: