From the course: Symmetric Cryptography Essential Training

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Challenge: Software-based LFSR

Challenge: Software-based LFSR

(upbeat music plays) - [Instructor] This is the chapter three challenge. In this challenge, I'd like you to do something that we wouldn't normally do, and that's implement an LFSR in software. LFSRs are incredibly fast in hardware, so what we're doing here is useful really only to demonstrate the process rather than being usable for any real application. I'm providing an initial state in the code. It's this. And new bits are an XOR of bits 10, 12, 13, and 15. And you should iterate this process 35 times. This is the skeleton code I'm providing. It should be pretty self-explanatory, but let's go through it anyways. I have an array of 16 integers, but we're only storing the values one and zero in them for this exercise. Sure, we could pack these into a single integer and do bitwise operations, but we're going to keep it simple here. So iterate through this LFSR 35 times, and print the output of those iterations to the screen. Like I said before, the bits that come into the register…

Contents