Download presentation
Presentation is loading. Please wait.
1
Announcements: Matlab: tutorial available at http://www.math.ufl.edu/help/matlab-tutorial/ Matlab: tutorial available at http://www.math.ufl.edu/help/matlab-tutorial/ http://www.math.ufl.edu/help/matlab-tutorial/ Questions?Today: Wrap up Hill ciphers Wrap up Hill ciphers One-time pads and LFSR One-time pads and LFSR Schedule change: skip Playfair cipher, start ch 3 tomorrow DTTF/NB479: DszquphsbqizDay 5
2
Next: one time pads Back to Vigenere: if the codeword were really long, say 25% as long as the entire plaintext, how many characters would contribute to each dot product? ____ What does this say about our ability to do a frequency analysis? What does this say about our ability to do a frequency analysis? Now consider the extreme case, the one- time pad…
3
One-time pads Represent the plaintext in binary, length n Works for text (from ASCII), images, music, etc Works for text (from ASCII), images, music, etc The key is a random vector of length n Ciphertext = plaintext XOR key Do message = 1000011, key = 1110010 message = 1000011, key = 1110010 Cipher = ??? Cipher = ??? ciphertext XOR key = ???
4
Unbreakable? Yes, for ciphertext only… Ciphertext:EOFMCKSSDKIVPSSAD Could be: thephoneisringingmeetmeinthegarage… I need the whole key to decrypt. What’s the downside to using a one-time pad? Variation: Maurer, Rabin, Ding et al’s satellite method If I’m willing to compromise some security…
5
Linear Feedback Shift Register (LFSR) Sequences Name comes from hardware implementation b 1 b 2 b 3 b 4 … b m-1 b m Feedback function Shift register Generated bit stream Need initial conditions (bits in register) and a function to generate more terms. Example: x 1 = 0, x 2 = 1, x 3 = 0, x 4 = 0, x 5 = 0; x n+5 = x n + x n+2 (mod 2) What does this remind you of in math? To encrypt plaintext of length n, generate an n- bit sequence and XOR with the plaintext.
6
Linear Feedback Shift Register (LFSR) Sequences A recurrence relation! Specify initial conditions and coefficients, for example: Specify initial conditions and coefficients, for example: x 1 = 0, x 2 = 1, x 3 = 0, x 4 = 0, x 5 = 0; x n+5 = x n + x n+2 (mod 2) Another way to write is x n+5 = 1x n + 0x n+1 + 1x n+2 +0x n+3 + 0x n+4 (mod 2) In general, Generate some more terms How long until it repeats? (the period of the sequence) 10 bits (0100010100) generates ____ bits Demo
7
Long periods LFSR can generate sequences with long periods Like Vigenere with long key: hard to decrypt! Like Vigenere with long key: hard to decrypt! Lots of “bang for the buck”! Lots of “bang for the buck”! But it depends on the key But it depends on the key Good example:x n+31 =x n + x n+3 (mod 2) How many bits do we need to represent this recurrence? 62 bits 62 bits How long is the period? Over 2 billion! Why? Over 2 billion! Why? There exist (2 31 – 1) 31-bit words There exist (2 31 – 1) 31-bit words Why “-1”? If it cycles through all of these, it’s maximal. Related to Mersenne primes See http://www.ece.cmu.edu/~koopman/lfsr/index.html for a list of maximal- period generators http://www.ece.cmu.edu/~koopman/lfsr/index.html Can you devise a bad example (one with period << 2 n -1)?
8
LFSR Demo Downside: very vulnerable to known plaintext attacks. Determine key length by computing determinants Theorem: If N is the length of the shortest recurrence that generates the sequence, then det(M N ) = 1 (mod 2) and det(M n )=0 (mod 2) for all n > N. Theorem: If N is the length of the shortest recurrence that generates the sequence, then det(M N ) = 1 (mod 2) and det(M n )=0 (mod 2) for all n > N. 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 … length = 5 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 … length = 5 Use the key length to solve for the recurrence. Verify your solution by using the solution to generate the whole key
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.