# Due Wednesday, September 7th

For Wednesday:

1. Here are solutions to the last daily post, please compare and make sure you feel good about it.
2. Today you will perform a Diffie-Hellman Key Exchange in order to send a message to someone on the #ciphertexts channel.  Big picture:  you’ll do a Diffie-Hellman Key Exchange to make a shared secret and then use that shared secret as a key for a very simple encryption (a sort of Caesar Cipher or One-Time Pad):
1. Create a secret message which is at most 6 letters long.  It should answer “Why CU?”  Please don’t make it longer or this exercise won’t work.  Use only the 26 letters of the alphabet, but you can use lower or upper case.
2. Turn it into an integer using the Text to Integer tool.  (This turns it into an integer by writing the letters in ASCII and making an integer base 255 with those digits.  There’s an Integer-to-Text tool on the same page to undo this process.)
3. If you need a review of Diffie-Hellman, check the lecture notes/video and Section 7.4 of the textbook.
4. We will use prime \$p=10^{15}+37\$, and its primitive root \$g=2\$.  The first box in the Diffie-Hellman Tools page will initialize this modular ring for you.
5. Use the Diffie-Hellman Tools (second box) to find a random secret a.  We’ll call this your secret key.  Keep it secret, maybe in your underwear drawer. (Joking! — actually safer if you copy it into a text file on your computer, because if you write it by hand you’ll make an error.)
6. Compute \$g^a\$ using the Diffie-Hellman Tools third box (no need to do this by hand!) We’ll call this your public key.
7. Announce your public key on discord #ciphertexts.
8. Find someone else’s public key (\$g^b\$) on discord.  Let’s call that other person Bob.  Use it to generate your shared secret (\$g^{ab}\$) with Bob (you’ll need your secret key for this).  Again, you can use the third box in the Diffie-Hellman Tools page to do the computations (no need to work by hand).
9. Add the shared secret to your message mod p.  Announce the result on discord as the secret message for BobInclude your public key for them, because they will need it.  You post might look like “My message for @soandso is X and my public key is Y.”
10. When someone sends you a secret message, figure out how to decrypt it and announce the result.  You may need to use the Diffie-Hellman Tools and the Text to Integer converter.
3. Here’s another exponent problem to practice on.  Try to compute \$13^{453^{2022}}\$ modulo \$100\$.  For multiplying two digit numbers, you can use a calculator. 🙂
4. If time remains, try to break someone else’s message that wasn’t directed to you!