Questions tagged [affine-cipher]

A type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple function (ax + b) mod m.

The affine cipher is a type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and converted back to a letter. The formula used means that each letter encrypts to one other letter, and back again, meaning the cipher is essentially a standard substitution cipher with a rule governing which letter goes to which. As such, it has the weaknesses of all substitution ciphers.

Each letter is enciphered with the function (ax + b) mod m, where b is the magnitude of the shift, and m is the length of alphabet. a has to be coprime to m in order for decryption to be possible.

Caesar's cipher is a most known example of affine cyphers, with formula (x + b) mod 26.

https://en.wikipedia.org/wiki/Affine_cipher

46 questions
3
votes
2 answers

Affine Cipher - Pair of plain to cipher text

Consider an affine cipher. The cryptanalyst observed the following plaintext/ciphertext pairs $(p,c)$: $(8,15)$ and $(5,16)$. Recover the key $(a,b)$ used in the encryption system above. What is the ciphertext corresponding to the plaintext $p=3$?…
Mikeez
  • 51
  • 3
1
vote
1 answer

Affine decryption

A message has been converted to ASCII and then encrypted with the formula: $$ax+b \equiv n \pmod {215475}$$ The encrypted message is: 091238 057542 070713 195800 138772 029721 035480 Each group of 6 numbers represents 2 letters. I know that the…
user34734
1
vote
2 answers

Decrypt affine cipher given encryption key

i have a ciphertext C=TLNJG formed using the equation c=(7p+11) mod 27,c equivalent to numerical equivalent character of ciphertext and p the plaintext how do i get the plaintext back? for encryption:c=(7p+11) mod 27 for decryption:p=5(c-11) mod…
mr.newbie
  • 39
  • 3
  • 7
0
votes
3 answers

Linear subspace and Affine subspace

I am currently reading a paper titled "Another view of division property" and encountered the terms "Affine subspace" and "Linear subspace". I am new to the field and having some difficulties to understand the topics. Can anyone describeb or give…
Radium
  • 157
  • 7
-1
votes
1 answer

use of encryption of plain text from 1 instead of 0

while encrypting the plaintext in an affine cipher we encrypt the alphabets with a=0,b=1,c=2,......z=25 and then use the modulo of 26. Can we instead use to encrypt the plaintext with a=1,b=2,c=3,....,z=26 and then use modulo of 27?
shadow kh
  • 101
  • 3
-2
votes
1 answer

Affine cipher of affine cipher, finding all possible values of a and b

We have $$e(x) \equiv ax + b \pmod{26}$$ where $a,b \in \{0,1,\dots,25\}$ and $\gcd(a,26) = 1.$ The question is how to find all possible values of $a$ and $b$ for which $$e(e(e(x))) \equiv x \pmod{26}$$ holds for all $x \in \{0,1,\dots,25\}.$
amn89
  • 1
-2
votes
1 answer

Affine Cipher formula for numbers

Im going to make a C++ program about Affine Cipher but i also want to encode the strings with numbers in it. I know for alphabet the formula is: TO ENCODE: X=(a*x)+b mod 26 TO DECODE: Y=Z*(y-b) mod 26 "Z is the inverse of a" But how can i imply…
Snxby
  • 1
-2
votes
1 answer

Affine Cipher - Greatest Common Divisor

Really simple question regarding the Affine Cipher. Can someone tell me how $3^{-1}$ is supposed to result in 9 in the following explanation below?