Skip to main content

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
74 views

Conceal time-based GUIDs with an affine-cipher?

I'd like to create a custom type of sortable GUID by concatenating an 8-byte nanosecond timestamp, 6 random bytes, a 1-byte node number, and a 1-byte counter. But, such a precise timestamp can be used ...
aiootp's user avatar
  • 814
1 vote
1 answer
750 views

Where did affine cipher get its name from?

I was wondering where did affine cipher get its name from. I am curious to know its origin and how it is related to the cipher. The Affine Transformation page on Wikipedia states: In Euclidean ...
Josh's user avatar
  • 135
0 votes
0 answers
96 views

How to encrypt affine cipher in block?

Assuming the alphabet of capital letters, if an affine linear cipher $v\to Av+b \bmod 26$ with block length $3$ maps plaintext ENCRYPTAGAIN to ciphertext ...
Prithvish111's user avatar
1 vote
2 answers
203 views

Can all affine cyphers be expressed with this formula

There are $26!$ permutations of the English alphabet. In Modern Cryptography textbook, William Easttom states that the basic formula for any affine cipher is $ax + b \equiv \pmod{26}$. I'm wondering ...
mark mark's user avatar
  • 113
0 votes
1 answer
200 views

Affine Cipher: what to do if the number isnt invertible over mod n? [duplicate]

I am currently solving a simple cryptanalysis problem where I need to decrypt a text file using frequency analysis. The text has been encrypted using an affine cipher over a 68 character alphabet ...
Mohamed Moustafa's user avatar
0 votes
0 answers
64 views

decode Vigenere cipher that was encoded with Affine cipher

How do I decode some text that has been encoded like this: affine(vigenere(text, vigenere_key), *affine_key)? I don't know keys to either of them. At first I ...
Leam's user avatar
  • 1
3 votes
2 answers
1k views

Text cipher option that can decrypt the same ciphertext to two DIFFERENT and DESIRED outputs given DIFFERENT keys (and/or alphabet)

I have a pen pal that I discuss with. In our latest discussion it was proposed to write a short message that is ciphered and have the other one find what it is, given some clues. I would like to ask ...
Lucian Viorel's user avatar
0 votes
3 answers
424 views

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 ...
Radium's user avatar
  • 177
0 votes
0 answers
68 views

Where can I find standardized implementations of lightweight cryptographic ciphers?

I am working on a project that requires encrypting messages with different ciphers. I am looking for the following ciphers: PRESENT, CLEFIA, LEA, Hill cipher, Affine cipher, Elliptic Curve ...
NotNotLogic's user avatar
0 votes
0 answers
32 views

How would you decrypt an affine cipher with only the ciphertext? [duplicate]

If I have only the ciphertext but the alphabet and the value of a and b are all unknown ... how would I go about this? I understand decryption with the key and alphabet, that is fairly easy but if we ...
liz's user avatar
  • 1
1 vote
0 answers
50 views

Proving at most one affine permutation mapping $x$ to $u$ and $y$ to $v$ with $x,y \in \mathbb{Z}_n$ and $\gcd(x−y,n) = 1$

Suppose that $x,y \in \mathbb{Z}_n$ with $\gcd(x−y,n) = 1$. Prove that for any $u,v \in \mathbb{Z}_n$ there is at most one affine permutation mapping $x$ to $u$ and $y$ to $v$.
Heaven's user avatar
  • 11
0 votes
0 answers
53 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 ...
princetongirl818's user avatar
-1 votes
1 answer
117 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,....,...
shadow kh's user avatar
  • 101
2 votes
1 answer
1k 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?
conchild's user avatar
  • 675
1 vote
0 answers
553 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-...
M.J.Watson's user avatar
0 votes
1 answer
1k 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 ...
Sarah's user avatar
  • 11
1 vote
1 answer
1k 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 ...
Network's user avatar
  • 13
0 votes
1 answer
792 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 ...
undergrad's user avatar
-2 votes
1 answer
433 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{...
amn89's user avatar
  • 1
3 votes
1 answer
785 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 ...
Temirzhan's user avatar
  • 217
3 votes
2 answers
2k 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. ...
Mikeez's user avatar
  • 51
1 vote
1 answer
2k 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 )$ ...
Akhil Nadh PC's user avatar
2 votes
1 answer
5k 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 ...
Vishrant's user avatar
  • 123
2 votes
1 answer
1k 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 ...
John's user avatar
  • 21
-2 votes
1 answer
420 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)...
Snxby's user avatar
  • 1
2 votes
1 answer
5k 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 ...
onur cevik's user avatar
3 votes
3 answers
569 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 ...
Legend of Overfiend's user avatar
5 votes
2 answers
564 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: ...
Wouter Doeland's user avatar
4 votes
2 answers
2k 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 ...
Crimson's user avatar
  • 49
1 vote
0 answers
356 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$ ...
user43397's user avatar
-1 votes
1 answer
7k 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 ...
ConfusedMathStudent's user avatar
-2 votes
1 answer
1k 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. ...
MooCow's user avatar
  • 99
1 vote
1 answer
103 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: ...
user avatar
3 votes
2 answers
517 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 ...
user avatar
4 votes
1 answer
3k 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})$ ...
Retikulum's user avatar
0 votes
1 answer
2k 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) ·(...
chers's user avatar
  • 31
-2 votes
1 answer
1k 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?
HansMusterWhatElse's user avatar
1 vote
2 answers
7k 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 get ...
mr.newbie's user avatar
4 votes
1 answer
760 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 $(...
hasad23's user avatar
  • 41
8 votes
1 answer
5k 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 ...
rockStar's user avatar
  • 183
1 vote
1 answer
10k 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 <...
free's user avatar
  • 15
2 votes
2 answers
3k 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 ...
Cryptoiskey's user avatar
2 votes
1 answer
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 ...
Gumboots's user avatar
4 votes
1 answer
8k 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 ...
Elior's user avatar
  • 143
1 vote
2 answers
938 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?
user5111's user avatar
1 vote
1 answer
2k 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 $...
ucas's user avatar
  • 129