
Explore the theory and practice of symmetric block ciphers and rc5. Implement rc5 in Rust using generics and native types, with cbc mode tests from the original paper.
Explore a simplified map of cryptography, distinguishing symmetric and asymmetric ciphers, protocols, and cryptanalysis, with examples like RSA, elliptic curves, and sha-256 hashing.
Explore the xor and left and right bit shift operators and their role in cryptography, with Rust examples. See how xor encrypts and decrypts, and how bit shifts move bits.
Differentiate stream ciphers from block ciphers, highlighting diffusion and confusion across rounds in block ciphers. Note XOR and pseudo random generators underpin stream cipher security.
Discover how feistel networks use left and right halves and a round function to create confusion and diffusion. Understand why Ark5 uses a feistel-like structure and remains invertible for decryption.
Explain the RC5 cipher, its data-dependent rotations, and a simple feistel-like structure with variable word size and rounds. Describe key expansion and two-word plaintext encryption.
Install rust and its toolchain, including rustup, rustc, and cargo, via a terminal script. Create a binary project, run cargo run to print hello world, and build in release mode.
Explore implementing a Rust encryption function for a two-word plaintext using a generic unsigned integer type and an extended key size 2r+1, with trait-based word operations, exporting as a library.
Implement the RC5 decryption function in Rust by deriving the inverse of encryption to recover A and B from the cipher text with the extended key and rounds.
discover key expansion for rc5: convert a byte key to word blocks, initialize L and S arrays with p and q, and expand two times the number of rounds.
Advance RC5 key expansion in Rust by converting a key byte array to a word array, defining the magic constants p and q, and initializing a vector of size t for the expansion.
Explore left shift and right shift operations in the RC5 cipher, using module w to prevent overflow for 32-bit unsigned integers, and implement these shift formulas in Rust with tests.
Implement a rotate-left (RCL) operation to prevent overflow, using a generic word trait and a U8 implementation, while testing with cargo test and exploring bitwise formulas.
fixes an overflow in left and right shift by converting to the w type and adds debug, tests, and assertions for robust rotation in the rc5 encryption implementation.
This lecture demonstrates replacing add and subtract operations with wrapping equivalents in Rust, using rotate left/right to avoid overflow, and tests showing overflow behavior in debug vs release builds.
Explore Rivest unit tests for RC5 with 32-bit words, a 16-byte key, and 12 rounds, plus discuss magic constants P_W and Q_W from irrational numbers and little-endian representation.
Run a Rivest unit test for the RC5 Rust implementation with a 16-byte key, two 32-bit words of plaintext, and 12 rounds, using the expand key function.
Rivest unit test - second part shows fixing key expansion errors and confirms correct RC5 encryption and decryption with a 16-byte key and 12 rounds.
Fix an off-by-one error by using until b minus one in the Rivest unit test. Run the encryption and decryption tests to confirm all pass.
Explore modes of operation for the RC5 block cipher, focusing on electronic code block mode, cipher block chaining, initialization vectors, xor chaining, and padding for encrypting large messages and files.
Extend the RC5 block cipher to encrypt and decrypt large plaintext by processing two word blocks with padding in cipher block chaining, with a Rust executable for file based encryption.
Build a Rust command line tool for RC5 CBC encryption that parses encrypt or decrypt options, reads input files, and writes output with a secret key.
demonstrate cbc encryption with rc5 in rust by parsing input to byte vectors, importing encrypt and decrypt, handling padding and data chunks, and producing ciphertext.
Decrypt RC5 ciphertext in cbc mode by processing the ciphertext, applying xor to recover the plaintext in Rust, using vectors and unsigned 32-bit integers.
Implement the CBC decrypt flow in Rust by using the previous ciphertext in the decrypt function, test padding removal, and validate decryption with correct and incorrect keys.
This course teaches you how to build an RC5 symmetric block cipher in Rust. If you are interested in learning cryptography or how to build practical applications in Rust, this course is definitely for you.
The course is divided into three main sections:
In the first one, we will explain the theory of symmetric encryption and block ciphers. We will see what diffusion and confusion mean, and we will look into the details of the RC5 block cipher.
In the second, we will implement the RC5 cipher using Rust. We will learn how, with Rust-Generics, we can extend the capabilities of the cipher to words of 32, 64, and 128 bits without duplicating code.
In the third one, we will implement a real-world application that uses the RC5 cipher and cipher block chaining mode to encrypt and decrypt large files.
I recommend you program the RC5 cipher by yourself as you look at the video and also to create your own Github Repository. This will serve as a showcase for your future employers that you know what you are talking about and that you have Rust and Cryptography experience. Most important of all I also recommend you to have fun and ask every question you have!