How Do You Solve an Affine Cipher with Given Mappings?

In summary, the conversation discusses the attempt to break an affine cipher by determining the encryption function used. It is believed that the ciphertext 'a' maps to the plaintext 'E' and 'v' maps to 'T'. By using equations and a reference sheet, the encryption function is determined to be E(x) = (147x + 10) mod 26. However, it is suggested to use 52 instead of 26 if both upper and lower case letters are used.
  • #1
Firestrider
104
0

Homework Statement


7) You are attempting to break an affine cipher. You believe that the ciphertext ‘a’ maps to the plaintext letter ‘E’ and that the ciphertext ‘v’ maps to the plaintext ‘T’. Determine the encryption function used based on these two pieces of information.

Homework Equations



Ciphertext “a” = 0, Plaintext “E” = 4
Ciphertext “v” = 21, Plaintext “T” = 19
E(x) = (ax + b) mod m; Given: m = 26.

The Attempt at a Solution



0 = (a(4) + b) mod 26 => Eq 1. Plug in 4 for x, 0 for E(x), 26 for m.
21 = (a(19) + b) mod 26 => Eq 2. Plug in 19 for x, 21 for E(x), 26 for m.
21 = (a(15)) mod 26 => Subtract Eq. 1 from Eq. 2.
7(21) = (7a(15)) mod 26 => Multiply both sides by modular multiplicative inverse of 15 mod 26, which is 7. Given from Reference Sheet.
147 = (a(105)) mod 26 => Simplified.
147 = (a) => Eq. 3. Identity:1 = aa-1 mod m.
0 = (147(4) + b) mod 26 => Plug answer (a) in from Eq. 3 to Eq. 1 to solve for b.
0 = (588 + b) mod 26 => Simplified.
b = 10. STUCK HERE, I USED WOLFRAM ALPHA TO CALCULATE THIS
0 = (147(4) + 10) mod 26 => Check.
21 = (147(19) + 10) mod 26 => Check.
Encryption Function: E(x) = (147x + 10) mod 26

Please help, I might be completely off base on my methods after Eq. 3 to solve for b.
 
Physics news on Phys.org
  • #2
I don't really know anything about ciphers. But I'm guessing you would want to use 52 instead of 26 since you are using both upper and lower case letters.

Disclaimer: I may not know what I'm talking about:shy:
 

FAQ: How Do You Solve an Affine Cipher with Given Mappings?

What is a Cryptography affine cipher?

A cryptography affine cipher is a type of substitution cipher used for encrypting messages by replacing each letter with another letter based on a mathematical function. It is a type of monoalphabetic cipher, meaning that each letter is always substituted with the same corresponding letter.

How does a Cryptography affine cipher work?

Affine ciphers use a mathematical function of the form ax + b mod m, where a and b are the key values and m is the size of the alphabet. Each letter of the message is represented as a number, and then the mathematical function is applied to encrypt the message. To decrypt the message, the inverse function is used with the same key values.

What are the advantages of using a Cryptography affine cipher?

The main advantage of using an affine cipher is that it is relatively easy to use and understand, making it ideal for beginner-level encryption. It also provides a higher level of security compared to other substitution ciphers, as it uses a mathematical function to encrypt the message rather than a fixed substitution pattern.

What are the limitations of a Cryptography affine cipher?

One limitation of an affine cipher is that it is vulnerable to frequency analysis, meaning that an attacker can analyze the frequency of letters in the encrypted message to decipher the key and decrypt the message. It is also only effective for encrypting messages in languages that use a Latin alphabet.

How can the security of a Cryptography affine cipher be improved?

To improve the security of an affine cipher, multiple rounds of encryption can be applied using different key values. This is known as a polyalphabetic cipher and makes it more difficult for an attacker to decipher the message. Additionally, using a larger alphabet size and a more complex mathematical function can also enhance the security of the cipher.

Back
Top