120 likes | 243 Vues
In this session, students will learn how to create pseudo-random numbers using Linear Feedback Shift Registers (LFSRs) and understand the methods used to evaluate the randomness of these bits. The objectives include generating a sequence of random bits based on primitive polynomials, testing the resulting bits for randomness through various statistical tests (Poker, Runs test, Long Run test), and ensuring the generated bits meet specified criteria. Students will produce a 20,000-bit sequence, analyze its randomness, and explore essential cryptographic practices.
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.