0

Why is the caesar cipher given by: $C\equiv P+k\,(mod\,26) \,$with$ \,0 \leq \,$C$\,\leq25$?

For me is this more logic: $C\equiv P+k\,(mod\,26) \,$with$ \,0 \leq \,$P$\,\leq25$

Because of the modulo 26 it's alwas true that $ \,0 \leq \,$C$\,\leq25$.

WinstonCherf
  • 1,022
  • Unless specified, $C$ can be any integer, for example $66\equiv23+17\pmod{26}$. – David Nov 27 '17 at 00:02
  • So it has to be true that 0≤ C≤25, but P can be any integer. Can you please explain why this is true? @David – WinstonCherf Nov 27 '17 at 00:05
  • No, both $P$ and $C$ can be any integer. But usually $P$ would be given and would be from $0$ to $m-1$. – David Nov 27 '17 at 00:11
  • But my tekstbook says it has to be true that 0≤C≤25... So C can not be any integer. So in this case 0≤C≤25 AND 0≤P≤25? @David – WinstonCherf Nov 27 '17 at 00:14
  • That's exactly what I said in my first comment: UNLESS SPECIFIED, $C$ can be any integer. That's why they had to say so in the book for $C$. Not for $P$ as in your question. – David Nov 27 '17 at 00:29

1 Answers1

1

When we write

$$ C \equiv P +k \pmod{m} $$

we mean that $C$ and $P+k$ are congruent modulo $m$. That is, they leave the same remainder when divided by $m$. For each integer $P+k$ there are infinitely many integers that are congruent to it modulo 26. So, that expression alone does not fix an encoding scheme. If, however, one specifies that $C$ has to be between $0$ and $25$ (included), then there's only one choice of $C$ for every choice of $P+k$.

If $P$ is also constrained to the same interval, then for a fixed choice of $k$ we have an invertible map that may be used for encryption and decryption.

There's another "mod," which may be the source of confusion here. When we write $x \bmod m$, we mean the unique number between $0$ and $m-1$ that is congruent to $x$ modulo $m$. However, the presence of $\equiv$ and the parentheses around the mod expression are clear signs that here we are dealing with the relation symbol, rather than with the binary operation symbol.

  • Update: My teacher says when C≡P+k(mod m) then 0≤C≤25 and ∈ {2,3,...,m−2} Can you please explain why P can't be 0, 1 and m-1? – WinstonCherf Nov 27 '17 at 00:52
  • Given the context I have, and assuming that $P$ is a letter of the alphabet in the plaintext, I see no reason why $P$ should not be 'A', 'B', or 'Z'. There certainly is no reason to impose that restriction from a modular arithmetic standpoint. – Fabio Somenzi Nov 27 '17 at 00:58
  • Sorry, I was to fast. It's the part of the lesson about RSA-encryption. When we use ≡^ (mod m) then 0≤C≤m-1 and ∈ {2,3,...,m−2}. But why P can't be 0, 1 and m-1? Thnx! – WinstonCherf Nov 27 '17 at 01:02
  • Yes, that's a very different question. What happens if you raise $1$ to the power $6$? – Fabio Somenzi Nov 27 '17 at 01:07
  • The P=0 and P=1 would give strange ciphers I thing... 0^6=0, 1^6=1 – WinstonCherf Nov 27 '17 at 01:09
  • Exactly: strange and useless. For $m-1$, have you seen the relation between the residue of a product and the product of the residues? – Fabio Somenzi Nov 27 '17 at 01:11
  • No, I don't thing so.. – WinstonCherf Nov 27 '17 at 01:13
  • Try computing the first few powers of $6$ modulo $7$. – Fabio Somenzi Nov 27 '17 at 01:17
  • 6^0≡1 (mod 7), 6^1≡6 (mod 7), 6^2≡1 (mod 7), 6^3≡6 (mod 7), 6^4≡1 (mod 7), 6^5≡6 (mod 7), 6^7≡1 (mod 7), 6^8≡6 (mod 7)... ok also very strange solutions :) So we had, 0≤C≤m-1 and ∈ {2,3,...,m−2} that's clear! Thnx! And finally just the last question: ∈ {2, 3, ... , ( − 2)} power 0 gives always 1, but why can't it be power 1 and ( − 1) and ()? – WinstonCherf Nov 27 '17 at 01:25
  • It has to do with this. You should ask a separate question to do justice to it. – Fabio Somenzi Nov 27 '17 at 01:35
  • Ok, I just posted a new question – WinstonCherf Nov 27 '17 at 01:41