120 likes | 224 Views
Stream Ciphers. Day 18. Objectives. Students will be able to… …to create a pseudo-random number with a linear feedback shift register. …understand some of the methods for checking to a set of bits for randomness. Problem: Random string of bits. Linear Feedback Shift Register.
E N D
Stream Ciphers Day 18
Objectives Students will be able to… • …to create a pseudo-random number with a linear feedback shift register. • …understand some of the methods for checking to a set of bits for randomness.
Primitive polynomials • Example: p(x) = x3 + x + 1 • Length until repeating is 2n - 1
Example 1: • Find a list of primitive polynomials. • Generate a list of random bits.
Example 2: • Generate a list of 20000 random bits. • 20-bit register • You will need… • a coin for the initial 20-bit register • Excel program from the SMA website.
Test or randomness • Create 20,000 bits • Count the number of 1’s: Must be in the 9654-10,346 range • FIPS 140-1 (Poker test) • Divide into 4-bit segments and convert to decimal numbers • Count and store the number of occurrences • 1.03 < x < 57.4
Test or randomness • The Runs test
Test or randomness • The long run test • Run of length 34 or more • On the sample of 20,000 bits, the test is passed if there are NO long runs
Example 3: • Test your 20,000 “random” bits for randomness using the 4 tests.