# Encrypting text using Caeser cipher in CFB mode

I am interested in learning and understanding cryptography and its application in every day life. One thing I can't seem to get my head around is encrypting plaintext using a block mode such as CFB. I want to use a Caesar block cipher in CFB mode to encrypt the following plaintext: lucozade with a key: 3.

So in this case, I get that using the Caeser block cipher the ciphertext for lucozade would be oxfrcdgh as the letters have shifted three places to the right. What I can't do is this encryption using CFB mode. How do I go about doing that? Like would I have to use the ciphertext oxfrcdgh as the IV?

Any help would be great

• Ceaser cipher has nothing to do with CFB mode. Oct 28, 2018 at 16:28
• @kelalaka so how do I encrypt the plaintext using caeser block cipher in cfb mode??? Oct 28, 2018 at 16:31
• @kelalaka lol how do I do that? that's the question. like I'm lost as to what I should be doing first. Do I use the output of the caeser cipher in the cfb? Would be amazing if you could answer my question - honestly make my day. I'm trying to self learn so sorry if I am a bit stupid Oct 28, 2018 at 16:39
• Is this an exercise in some textbook or online tutorial? I'm asking because, while one can define something analogous to CFB mode with a Caesar cipher in place of the block cipher, and while doing so could be a useful educational exercise, the result will be a) completely insecure for any practical purpose, and also b) not well defined unless you also specify a replacement for the bitwise XOR operation that will work on the Caesar cipher alphabet (which is doable, but there's more than one option to choose from). Oct 28, 2018 at 16:46
• @IlmariKaronen yeah it was from some old textbook exercises. how would i encrypt the plaintext lucozade using the caeser block cipher in cfb mode?? Oct 28, 2018 at 16:49

## Caesar cipher

You are confusing Caesar cipher with block ciphers.

In Caesar cipher the ciphertext is calculated as

$$c_i = p_i + 3 \bmod 26$$

There is no security in Caesar Cipher. A ciphertext only attack possible, as worst scenario.

## CFB Caesar cipher

$$c_i = c_{i-1} + 3 + p_i \bmod 26$$, with $$c_0 = IV$$

And, the decryption;

$$p_i = c_i - 3 -c_{i-1} \bmod 26$$, with $$c_0 = IV$$

Example : $$P=lucozade = \{11,20,2,14,25,0,3,4\}$$

Let choose $$IV = f = 5$$

\begin{align} c_1 &\equiv IV + 3 + p_1 \bmod 26 \equiv 5 + 3 + 11 \bmod 26 \equiv 19 \text { that is } T\\ c_2 &\equiv c_1 + 3 + p_2 \bmod 26 \equiv 19 + 3 + 20 \bmod 26 \equiv 16 \text { that is } Q\\ c_3 &\equiv c_2 + 3 + p_3 \bmod 26 \equiv 16 + 3 + 2 \bmod 26 \equiv 19 \text { that is } T\\ c_4 &\equiv c_3 + 3 + p_4 \bmod 26 \equiv 19 + 3 + 14 \bmod 26 \equiv 10 \text { that is } K\\ \end{align}

• Thanks for explaining this to me sir! You are a star! Just one question please, why or where did you get the following formula from: ci=ci−1+3+pimod26? I just want to understand the logic or reasoning as to how to derive the formula or where you get it from, thats all :). Otherwise, it makes sense Oct 29, 2018 at 23:19
• So I take it that the +3 mod 26 would be in the block cipher bit and then you just add the value of the plaintext so like 11 for L? Genius sir, how do you know such formulas like is there a book explaining this at least? Another thing, say if I use a IV say H = 7 but I don't tell you the IV value - could you still decrypt my ciphertext?? Oct 29, 2018 at 23:26
• I don't know where you can find in book, maybe in some exerciese. IV's are normally send unencrypted and there is no secuirty problems there. See, CBC and CTR mode of operations. This encryption, CFB Caesar is not secure. Within seconds a computer can show you all possible plaintext under the total IV's. IV's aim is randomizing the encryption to prevent the same plaintext get the same encryption. Oct 29, 2018 at 23:31
• Just out of interest, are there any softwares that allow me to experiment with this CFB Caesar mode? You know if any other formulas could be used to generate such ciphertexts? I just want to visually see it all Oct 29, 2018 at 23:37
• I accepted your answer BTW :). Oct 29, 2018 at 23:38