0
$\begingroup$

is there an encryption algorithm where no key is wrong, but only one key is right? essentially, if I encrypt some data with key X, any random "key" can "decrypt" the text, but using a random key essentially returns some random rata, and not the actual data that was encrypted using the key X.

The objective is essentially to confuse hackers that have access to the encrypted data.

I tried using some of the mainstream algorithms, but if I use the key Y instead of key X, it basically says "wrong key", which is not what I am looking for.

$\endgroup$

1 Answer 1

2
$\begingroup$

The objective is essentially to confuse hackers that have access to the encrypted data.

Generally, we assume an attacker is able to distinguish the valid decrypted data from random gibberish (which is what a decryption with a wrong key would yield), and so a decryption failure really doesn't give the attacker much additional information. In addition, in general, we try to use keys that are so long that the attacker would find it useless to try random keys.

That said, there is another reason for detecting decryption failures. One thing that the attacker might attempt is to modify the ciphertext, and then pass that modified ciphertext to the valid decryptor, and see how he reacts. If the ciphertext modification causes a small variation in the decryption (and the valid decryptor reacts to it, based on what it came out as), this gives information to the attacker, and we try to avoid that. One real example of this is "padding attacks" against CBC mode. To avoid this, we perform an integrity check on the ciphertext, either by applying a MAC (message authentication code) to the ciphertext, or use a 'combined block cipher mode' (aka AEAD) which includes such an integrity check internally.

That said, it is possible to design a ciphertext mode such that any change to the ciphertext would result in a random looking plaintext (even with the correct key); with such a mode, we could make it so that decryption failure never happens while retaining some security against 'chosen ciphertext' attacks. However, such 'garbling modes' are necessarily less efficient (because they have to make sure that a change to the end of the ciphertext causes a change to the beginning of the decrypted plaintext, hence a single pass encryption algorithm cannot suffice.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.