Score:0

How to encrypt affine cipher in block?

ph flag

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 BLOCKCIPHERS, what are $A$ and $v$?

I referred a paper, there it is given as like this, *As an example, suppose we want to take our block-length to be 4. This means that we divide our message into blocks of 4 letters and encrypt each block separately. The largest number we could end up with is 456,975 (corresponding to the highly unlikely 4-letter block ”ZZZZ”), and so we need to be sure that our modulus is greater than 456,975. We could use 456,976 but it’s just as easy (if not easier) to use 1,000,000. Now we proceed just as before. We choose $a$ and $b$ and set $\epsilon (m) = am + b \bmod 100000$

So my approach is to divide it as ENC RYP TAG AIN and BLO CKC IPH ERS and to find a and b, please help me to solve this.

kelalaka avatar
in flag
Hint for the first part: Set equations and solve them? there are tons of explanations around here and there for this. The second part is the encoding issue, take the 4 letters `XYZT`and represent them as $X*26^0 + Y*26^1+Z*26^2+T*26^3 \bmod 10^6$. and note that $456975 = 26^4$. The greater than now makes clear?[typo corrected]
Prithvish avatar
ph flag
@kelalaka the two equations of first 2 characters EN -> **(4a + b) mod 26 = 1** and **(13a + b) mod 26 = 11** by solving those, got **a=4, b=11** if I encrypt `ENCRYPAGAIN` I'm getting `BLTBDTJLJLRL` but in question they asked the values of _A_ and _v_.
kelalaka avatar
in flag
You can find them with known-plaintext attack. $v$ is the name of the mapping $A$ and $b$ are the keys.
Prithvish avatar
ph flag
I got it but the key A and b must be same right, but here keys are varying for every character.
kelalaka avatar
in flag
This is one of the reasons why these kinds of questions are off-topic. Why do you take modulus $\bmod 10^6$ not $26^3$?
Prithvish avatar
ph flag
Okay, leave about the paper that I reffered, it's just a thought I had, please suggest me an exact approach for that question to solve.
Prithvish avatar
ph flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/133736/discussion-between-prithvish-and-kelalaka).
kelalaka avatar
in flag
Maybe it is $X*26^0 + Y*26^1+Z*26^2$ maybe $X*26^2 + Y*26^1+Z*26^0$, I'm ending my help here.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.