From the course: Symmetric Cryptography Essential Training
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Challenge: Implementing Diffie–Hellman
From the course: Symmetric Cryptography Essential Training
Challenge: Implementing Diffie–Hellman
(bright music) - [Instructor] This is the chapter six challenge, the last challenge. I'd like you to implement a very limited version of the Diffie-Hellman key exchange. You're going to simulate both the sender and the receiver in this one, and you'll be without skeleton code. We'll use relatively small integers in this case, even though actual Diffie-Hellman uses numbers that are thousands of bits long. My usual warning here. This is not secure. The numbers we are working with here are far too small to be useful. Here are a few requirements for the code. The modulo you'll use is m equals 13. The base you'll use is g equals 7. The random exponents you should use should be between 3 and 12, inclusive. You should use 64-bit unsigned integers for all of your calculations. This will give you enough room so nothing overflows as you're doing your calculations. And then, here's the sequence of steps your program should take. Alice generates a random exponent privateA to calculate publicA…
Contents
-
-
-
-
-
-
-
-
(Locked)
Exchanging keys1m 34s
-
(Locked)
Key length and large numbers4m 26s
-
(Locked)
The importance of randomness to cryptography2m 26s
-
(Locked)
Modular arithmetic2m 46s
-
(Locked)
Diffie–Hellman key exchange2m 29s
-
(Locked)
Challenge: Implementing Diffie–Hellman2m 5s
-
(Locked)
Solution: Implementing Diffie–Hellman1m 17s
-
(Locked)
-