0

I'm wondering if decrypting with a wrong key is the same a encrypting in a different way.

For example if I encrypt the message "hello" with Caesar cipher with key = 3 it will give the message "khoor" but if I decrypt it with key = 2 the result will be "ifmmp". So we can say, decrypting a message encrypted with Cesar cypher will be the same as encrypting the encrypted message with -wrongKey.

But in a general way, if I decrypt a message with a wrong key, do I encrypt the encrypted message in a different way?

2 Answers2

2

In general this is a moot point, as modern encryption schemes are designed so that the recipient knows if they have used the correct key or not. It is an interesting question to ask about encryption primitives, like a block cipher. Put more precisely, you are asking whether there is always a $k_3$ such that

$D_{k_2}(E_{k_1}) = E_{k_3}$

This is essentially asking if encryption forms a group, and in general the answer is no. See e.g. Is Triple-DES a group?. There are notable exceptions. You've seen that Caesar cipher is one, and Vigenere is another.

bmm6o
  • 1,122
  • 7
  • 18
-1

Generally, as mentioned in the comments, if you use an authenticated cipher with an independently chosen key, then decryption will fail with very high likelihood, and can therefore not be considered encryption. It's the same thing basically with padded modes such as CBC. If you'd use it with padding then the decryption will fail with high probability (although once in ~256 is not as high as you would expect with an authenticated cipher).

On the other hand, with CTR mode and most stream ciphers, encryption = decryption by definition (XOR of a key stream with the plaintext / ciphertext). And for block ciphers (which, by themselves, are not semantically secure), you can use them in both directions. In that case yes, your premise is correct. Note that this answer disregards how the nonce or IV is handled (it can e.g. be established out of band).

I'll not go into asymmetric ciphers much; lets us please agree that encryption with a private key is usually not possible.

So it entirely depends on the cipher scheme.

Maarten Bodewes
  • 96,351
  • 14
  • 169
  • 323