Affine Cipher
The Affine cipher method is an extension of the Caesar cipher method, which multiplies the plaintext with a P value and adds it with a shift b resulting in the C ciphertext expressed by congruent functions:
C ≡ m P + b (mod n) (2.3)
Which n is the size of the alphabet, m is an integer which must be relatively prime with n (if it is not relatively prime, then decryption cannot be done) and b is the number of shifts (Caesar cipher is a special form of Affine cipher with m = 1). To do the description, equation (2.3) must be solved to get P. The concordance solution only exists if inver m (mod n), expressed as m-1. If m-1 exists then the decryption is carried out with the following equation
P ≡ m-1 (C - b) (mod n) (2.4)
To do the decryption, you will first count 7-1 (mod 26), which can be calculated by solving the linear continuity:
7x ≡ 1 (mod 26)
The solution is x ≡ 15 (mod 26) because 7.15 = 105 ≡ 1 (mod 26). So, for decryption use concordance:
P ≡ 15 (C - 10) (mod 26)
The calculation is as follows:
C1 = 0 àP1≡ 15. (0 - 10) = -150 ≡ (mod 26) (letter ‘G’)
C2 = 14 àP2≡ 15. (14 - 10) = 60 ≡ 8 (mod 26) (letter ‘I’)
C3 = 9 àP3≡ 15. (9 - 10) = -15 ≡ 11 (mod 26) (letter ‘L’)
C4 = 5 àP4≡ 15. (5 - 10) = -75 ≡ 3 (mod 26) (letter ‘D’)
C5 = 10 àP5≡ 15. (10 - 10) = 0 ≡ 0 (mod 26) (letter ‘A’)
The Affine cipher method is an extension of the Caesar cipher method, which multiplies the plaintext with a P value and adds it with a shift b resulting in the C ciphertext expressed by congruent functions:
C ≡ m P + b (mod n) (2.3)
Which n is the size of the alphabet, m is an integer which must be relatively prime with n (if it is not relatively prime, then decryption cannot be done) and b is the number of shifts (Caesar cipher is a special form of Affine cipher with m = 1). To do the description, equation (2.3) must be solved to get P. The concordance solution only exists if inver m (mod n), expressed as m-1. If m-1 exists then the decryption is carried out with the following equation
P ≡ m-1 (C - b) (mod n) (2.4)
To do the decryption, you will first count 7-1 (mod 26), which can be calculated by solving the linear continuity:
7x ≡ 1 (mod 26)
The solution is x ≡ 15 (mod 26) because 7.15 = 105 ≡ 1 (mod 26). So, for decryption use concordance:
P ≡ 15 (C - 10) (mod 26)
The calculation is as follows:
C1 = 0 àP1≡ 15. (0 - 10) = -150 ≡ (mod 26) (letter ‘G’)
C2 = 14 àP2≡ 15. (14 - 10) = 60 ≡ 8 (mod 26) (letter ‘I’)
C3 = 9 àP3≡ 15. (9 - 10) = -15 ≡ 11 (mod 26) (letter ‘L’)
C4 = 5 àP4≡ 15. (5 - 10) = -75 ≡ 3 (mod 26) (letter ‘D’)
C5 = 10 àP5≡ 15. (10 - 10) = 0 ≡ 0 (mod 26) (letter ‘A’)
Show More