Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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`.

0
votes
0answers
29 views

What choices of $a$ and $b$ of the affine cipher lead to proper encryption functions [duplicate]

Suppose I consider the affine cipher defined by $E(x) = ax + b \bmod n$ on the standard alphabet of 26 letters. Which choices of $a$ and $b$ lead to proper encryption functions? Using the ...
-1
votes
1answer
36 views

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,....,...
2
votes
1answer
185 views

AES with linear S-Box

If the AES S-Box is replaced with a linear or affine transformation, for instance the identity mapping $\sigma(x)=x$, does the cipher become entirely affine and hence trivially weak?
1
vote
0answers
192 views

Cryptanalysis affine cipher and substitution cipher

1) Consider the chosen-plaintext attack on the simple substitution cipher. How many chosen plaintext characters suffice to uniquely determine the key? My answer was: 26! 2) Consider the chosen-...
0
votes
1answer
189 views

Formula for E(m) of the Atbash Cipher

I'm studying mathematical cryptography and have been asked to find the encryption function for the Atbash cipher I know that it means a=z, b=y, c=x and so on but putting it into a formula has me a bit ...
1
vote
1answer
275 views

Stuck on an affine cipher exercise

I'm tired and can't seem to get the right answer for the following exercise: Alice sends a message to Bob, but he doesn't know the key. He knows only that the first two plaintext letters are C and ...
0
votes
1answer
382 views

Decryption using affine cipher

I am doing probabilistic decryption, I was given that A and E had the highest frequency count in the plain text. H and X have the highest frequency in the encrypted text. So in solving for a and b I ...
-2
votes
1answer
202 views

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{...
3
votes
1answer
280 views

Affine Cipher Keys that map plaintext to a given ciphertext

We first need to show that for each pair of plaintext-ciphertext letters ( x,y ), there are exactly 12 keys that encrypt x to y . For each choice of a , the key ( a,y − ax ) encrypts the ...
3
votes
2answers
394 views

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. ...
1
vote
1answer
425 views

Affine Cipher Cryptanalysis

I am trying to perform Cryptanalysis on Affine cipher . Given Plain Text "GO" and cipher text "TH" We know , $G =6 , O=14 , T=19 , H= 7$ By brute force method I'm getting key $(a,b)$ as $(5,15 )$ ...
0
votes
1answer
974 views

Affine cipher : Why it is required to have GCD(a, m) equals to 1

In the Affine cipher, the key $k = (a, b)$ should have the following property, i.e. GCD of $a$ and the modulus should be 1: $\gcd (a, m) = 1$, where $m$ is the set of possible moduli My question ...
3
votes
1answer
307 views

Cracking affine cipher with plaintext

Alice and Bob decide to use the prime $p = 601$ for their affine cipher. The value of $p$ is public knowledge, and Eve intercepts the ciphertexts $c_1 = 324$ and $c_2 = 381$ and also manages to find ...
-3
votes
1answer
163 views

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)...
3
votes
1answer
692 views

Is there a way to find $a$ and $b$ keywords in an affine cipher when only ciphertext but no plaintext is known?

I know simple formulas like $$E(x) = (ax+b)\pmod n$$ where $E(x)$ stands for encryption, $$D(y)= z(y-b)\pmod n$$ where $D(y)$ stands for decryption, and $$ax==1\pmod n$$ Assuming someone gives ...
2
votes
3answers
217 views

How is the affine cipher a permutation?

It seems there would be some collisions in what the different symbols map to, resulting in loss of information. For example, say we use the English alphabet, multiply by 2 and take the congruence ...
4
votes
2answers
401 views

Affine plaintext attack with GCD != 1

I'm trying to crack an affine cipher, but when cracking I cannot find the inverse of a number because the GCD is not 1. This is my plaintext and this is my ciphertext: ...
1
vote
0answers
288 views

Have affine ciphers actually been used in practice?

I have been been studying some basic ciphers, and learnt about the affine cipher where the encryption function is given by $ax+b \pmod{26}$ for an alphabet with 26 characters. This is a very insecure ...
1
vote
0answers
184 views

Affine cipher finding the decryption map

Given two letters of the plaintext 'ZP' corresponding to the ciphertext 'AE' respectively, I have found the key to be (a,b)=(10,10) (modulo 26). Therefore the decryption map $D(x)=a^{-1}(x-a)\bmod26$ ...
-2
votes
1answer
3k views

How to make sense of the decryption formula for Affine ciphers?

Hi guys so I'm investigating Affine ciphers and I need to understand a field of mathematics I'm not familiar with, which is modular arithmetic. The formula for encrypting a letter $x$ using the affine ...
-2
votes
1answer
422 views

Given alphabetic key and cipher text decrypt the cipher text [closed]

I've been at this for a while. I've been given two things Ciphertext = bsaspp kkuosp Key = rsidpy dkawoa Now seeing the domain that the characters are in. ...
1
vote
1answer
80 views

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: ...
2
votes
2answers
309 views

How does this affine cipher work?

I have a question about how I need to solve the following: A sentence has been changed to ASCII and then encrypted with the formula $E(x) = ax + b \bmod 256256$. All I know is that the first 4 ...
5
votes
1answer
1k views

How to attack polyalphabetic affine cipher with only ciphertext?

How to attack polyalphabetic affine cipher with only the ciphertext? A polyalphabetic affine cipher can be seen as the composition of an affine cipher ($p \mapsto c \equiv a \times p + b \pmod{26})$ ...
-2
votes
1answer
611 views

Perfect secrecy of affine cipher

Given any probability distribution P r on the set $\{k ∈ \mathbb{Z}_{26} : \gcd(k, 26) = 1\}$. Show that the Affine Cipher achieves perfect secrecy if the key (k, a) is used with probability $Pr(k) ·(...
-2
votes
1answer
566 views

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?
1
vote
2answers
3k views

Decrypt affine cipher given encryption key [duplicate]

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 ...
4
votes
1answer
321 views

Affine cipher and plaintext attacks, how to find the base modulo?

Last year, a question concerning plaintext attacks was posted at Mathematics.SE: “Plaintext attacks: affine cipher”. I have no problem to see how to solve it when we are given two ciphertexts and $(...
6
votes
1answer
2k views

Affine Cipher over an Affine cipher

I would like to know your view about the title, encrypting a plain text with an affine cipher then encrypting that ciphertext once more using the same cipher, but of course different keys. Would it be ...
1
vote
1answer
4k views

Affine cipher: calculate the key from a known plaintext/ciphertext pair

Suppose I have a ciphertext that I know is encrypted using an affine cipher in $\mathbb{Z}_{26}$. The plaintext begins with es and the corresponding ciphertext is <...
0
votes
1answer
1k views

Prove that the affine cipher over Z26 has perfect secrecy if every key is used with equal probability of 1/312

Prove that the affine cipher over Z26 has perfect secrecy if every key is used with equal probability of 1/312. Just some guidance/help with this problem would be greatly appreciated not sure how to ...
1
vote
1answer
2k views

Decrypting an Affine Cipher with known characters

I am trying to cryptanalyse multiple cipher–texts that I know are encrypted by different Affine ciphers. I have already analysed the frequency that each character occurs, and compared it to a ...
4
votes
1answer
6k views

Knowing the key, how do I decrypt the affine cipher?

I have an encryption function $$E(p) = (ap + b) \mod{26}$$ where the parameters are $a=7$, $b = 10$, and $p$ is the plaintext letter. I was asked to decrypt the ciphertext ...
1
vote
2answers
758 views

How many oracle calls to break an affine cipher in a chosen plaintext attack?

Assuming the ability to launch Chosen Plaintext Attacks (CPA), how many oracle calls does an attacker need to break the affine cipher? How does it work?
1
vote
1answer
1k views

Cryptanalysing Affine cipher

I am trying to cryptanalyse a cipher–text encrypted by Affine cipher. The encryption formula is: $c = f(x) = (ax+b)\bmod m$, where $a$ and $b$ are unknown constants; $x$ is a plain-text symbol, and $...