Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

16.8: The key exchange

( \newcommand{\kernel}{\mathrm{null}\,}\)

Substitution ciphers

In the questions below, if it specifies an alphabetic cipher, then the original map used letters only: ABCDEFGHIJKLMNOPQRSTUVWXYZ. If it specifies an alphanumeric cipher, then the original map used letters and numbers: ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789

1. Encrypt the message “SEND SUPPLIES” using an alphabetic Caesar cipher with shift 7 (mapping A to H).

2. Encrypt the message “CANCEL CONTRACT” using an alphanumeric Caesar cipher with shift 16 (mapping A to Q).

3. Decrypt the message “2R1 ONO 5SN OXM O“ if it was encrypted using an alphanumeric Ceasar cipher with shift 10 (mapping A to K).

4. Decrypt the message “RJJY NSAJ SNHJ“ if it was encrypted using an alphabetic Ceasar cipher with shift 5 (mapping A to F).

For questions 5-8 use this substitution mapping:

Original: ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
Maps to: HLCO2BQF5WRTZN1G4D8IJ6SUVK3A0X9YME7P

5. Use the substitution mapping to encrypt the message “DEAR DIARY”

6. Use the substitution mapping to encrypt the message “ATTACK AT SUNRISE”

7. Use the substitution mapping to decrypt the message “Z2DQ 2D1N”

8. Use the substitution mapping to decrypt the message “Z22 IHI3 YX3”

Transposition ciphers

9. Encrypt the message “Meet in the library at ten” using a tabular transposition cipher with rows of length 5 characters.

10. Encrypt the message “Fly surveillance over the northern county” using a tabular transposition cipher with rows of length 8 characters.

11. Decrypt the message “THE VHI NIE SAN SHT STI MQA DAN SDR S“ if it was encrypted using a tabular transposition cipher with rows of length 7 characters.

12. Decrypt the message “DOLR UTIR INON KVEY AZ“ if it was encrypted using a tabular transposition cipher with rows of length 6 characters.

13. Encrypt the message “Buy twenty million” using a tabular transposition cipher with the encryption keyword “RENT”.

14. Encrypt the message “Attack from the northeast” using a tabular transposition cipher with the encryption keyword “POWER”.

15. Decrypt the message “RYL OEN ONI TPM IEE YTE YDH WEA HRM S” if it was encrypted using a tabular transposition cipher with the encryption keyword “READING”.

16. Decrypt the message “UYH SRT ABV HLN SEE L” if it was encrypted using a tabular transposition cipher with the encryption keyword “MAIL”.

Shifting substitution ciphers

17. Encrypt the message “SEND SUPPLIES” using an alphabetic Caesar cipher that starts with shift 7 (mapping A to H), and shifts one additional space after each character is encoded.

18. Encrypt the message “CANCEL CONTRACT” using an alphabetic Caesar cipher that starts with shift 5 (mapping A to F), and shifts one additional space after each character is encoded.

Modular arithmetic

19. Compute

  1. 15mod4
  2. 10mod5
  3. 257mod11

20. Compute

  1. 20mod4
  2. 14mod3
  3. 86mod13

21. Determine if 4 is a generator modulus 11

22. Determine if 2 is a generator modulus 13

23. Use the modular exponent rule to calculate 15710mod5

24. Use the modular exponent rule to calculate 1338mod6

Diffie-Hellman-Merkle key exchange

25. Suppose you are doing a key exchange with Marc using generator 5 and prime 23. Your secret number is 7. Marc sends you the value 3. Determine the shared secret key.

26. Suppose you are doing a key exchange with Jen using generator 5 and prime 23. Your secret number is 4. Jen sends you the value 8. Determine the shared secret key.

RSA

27. Suppose that Alice has computed n=33,e=7, and d=3. Show how Bob would encrypt the message 5 and how Alice would then decrypt it.

28. Suppose that Alice has computed n=55,e=7, and d=13. Show how Bob would encrypt the message 8 and how Alice would then decrypt it.

Extensions

29. To further obscure a message, sometimes the usual alphabet characters are replaced with other symbols. Design a new set of symbols, and use it to encode a message. Exchange with a friend and see if they can decode your message.

30.To make an encryption harder to break, sometimes multiple substitution and transposition ciphers are used in sequence. For example, a method might specify that the first letter of the encryption keyword be used to determine the initial shift for a Caesar cipher (perhaps with a rotating cipher), and also be used for a transposition cipher. Design your own sequence of encryption steps and encrypt a message. Exchange with a friend and see if they can follow your process to decrypt the message.

31. When using large primes, computing values like 6724mod83 can be difficult on a calculator without using additional tricks, since 6724 is a huge number. We will explore an approach used.

  1. Notice that 672mod83 is fairly easy to calculate: 672mod83=4489mod83=7. Since 674 mod 83=(672)2 mod 83 can be rewritten using the modular exponent rule as (672mod83)2mod83, this is also easy to evaluate:674mod83=(672mod83)2mod83=72mod83=49 This process can be continued to find 678 mod 83 as (64)2 mod 83 . Find this value, then find 6716mod83 and 6732mod83
  2. There is a rule that (ab)modn=(amodn)(bmodn)modn Noting that 17000=170×100, calculate 17000 mod 83 using the rule above.
  3. Note that 675=67467. Use this, along with the rule from above and the results from part a to compute 675 mod 83
  4. Note that 677=674+2+1=674672671. Compute 677 mod 83.
  5. Write 6724 as a product of powers of 67, and use this to compute 6724 mod 83

32. Use the process from the previous question to evaluate 2334mod37.

33. To encrypt text messages with RSA, the words are first converted into a string of numbers, and then encrypted. Several characters are usually combined together to produce a message number smaller than the modulus, but approximately the same size. Look up an ASCII table to convert the message “SCALE THE WALLS” to numbers, then encrypt it using the RSA public key n=10823,e=5. Since ASCII characters are two digits, pair up characters to form four-digit numbers before encoding. For example A is 65 and B is 66, so the character pair AB could be treated as the number 6566 and encrypted as 10148

34. Explore approaches to steganography that don’t require specialized software. Attempt to hide a message using one of these techniques, and see if a fellow student can detect the message.

35. When you visit a secure website, your web browser will report that the site’s identity has been verified by a third party, called a certificate authority. This is meant to assure you that you are visiting the actual company’s website. Research how these certificates work.

clipboard_eeff1b6156c4b43775cc610097b743fdf.png


This page titled 16.8: The key exchange is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by David Lippman (The OpenTextBookStore) via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?