Topic: Modular Arithmetic, Cryptography, and Inverses
Choose a personally meaningful message (8–15 words). Convert it to uppercase, remove non-alphabetic characters, and encrypt it using the Affine Cipher:
E(x) = (ax + b) mod 26
a
that is coprime with 26.a
.Write a program (Python/Java/JS) that encrypts/decrypts using mod 95 for ASCII printable characters. This allows for punctuation, spaces, and symbols.
If you have extensive programming experience, you are free to make your program as sophisticated as you like. Consider encrypting pairs of letters instead of single letters. How might your modulus need to change? Consider adding a nice user interface (either command-line or gui). If you are relatively new to programming, keep it simple! Ask for guidance if you'd like some ideas.
Explain: How does using mod 95 change your logic?
a
not coprime with 26 and try decrypting. Explain why it fails.Category | Points |
---|---|
Hand calculations & explanation (Part 1) | 3 |
Modular inverse & theory (Part 2) | 3 |
Working code & ASCII mod extension (Part 3) | 4 |
Error handling & edge cases (Part 4) | 2 |
Reflection & analysis (Part 5) | 3 |
Submission: Upload a single ZIP folder including: