# Two working decipher keys giving various, valid results for one ciphered message - is it possible?

Let's assume following scenario:

There's a ciphered message. Two decipher keys (let's name them A and B) are known.

Message deciphered with key A gives valid result - normal text but with no secret information. Let it be a poem or other meaningless content.

The same message deciphered with key B gives the right output, the real secret message revealed.

Please tell me, is it possible (or well-known and existing method/algorithm), or just a work of fiction? I've read about it in some novel a long time ago and tried to figure it out on my own, but with no result. But I'm rather ignorant in terms of cryptography so I might just miss something obvious.

Thank you in advance for any help - just a simple name of ciphering method or link to Wikipedia or something will be enough. I don't even dare to ask for the full and detailed explanation.

• The one of the simpler examples is one-time pad. Assume you have two texts, $X$ and $Y$. First pick a random key $A$ and compute ciphertext $C = X \oplus A$. Then derive key $B$ as $B = C \oplus Y$. So, $C \oplus B = Y$ and $C \oplus A = X$. – Carl Löndahl Sep 10 '18 at 9:22

This property can be achieved with a One-time pad.

"In fact, it is possible to "decrypt" out of the ciphertext any message whatsoever with the same number of characters, simply by using a different key, and there is no information in the ciphertext that will allow Eve to choose among the various possible readings of the ciphertext."

This is nicely shown in this example from Wikipedia (section "Attempt at cryptanalysis").

Thank you guys very much for your help and explanations.

I've started to Google for more info about one-time pad technique and found another suitable solution called Denial Encryption. Well, two of the most interesting content is available here, at crypto.stackexchange.com.... unfortunately I didn't find them before - maybe I didn't specify the proper search query - please don't blame me :)

Here they are, in case somebody looks for similar problem in future:

Deniable Encryption (*term corrected according to comment by Gordon Davisson)

Something similar, that could be helpful too

Thank you again and have a nice day.

P.S. I'm fully satisfied with answers received, so this topic could be freely closed/archived - I don't know how to do it on my own.

• Correction: it's "deniable encryption". Web searches will work better with the correct spelling :-) And there's a tag for it here on crypto.se: deniable-encryption. – Gordon Davisson Sep 10 '18 at 11:15
• Yes, you're right - my fault. Thanks for letting me know, I've corrected the error. – Bario Malotelli Sep 10 '18 at 11:59