1
$\begingroup$

Suppose I want to encrypt $mssg$ using One-Time-Pad, and I want the $mssg$ to be encrypted twice.

Once with $k_1$ and second with $k_2$

Is it still possible to detect my $mssg$?

lets say:

  • $c_1 = mssg \oplus k_1$
  • $c_2 = mssg \oplus k_2$

$c_1 \oplus c_2 = k_1 \oplus k_2$

$\endgroup$
0

1 Answer 1

0
$\begingroup$

That is perfectly safe, there is no way you could recover the message from that as long as k1 and k2 truely are uniformly random and independent.

This is because both ciphertexts are perfectly secure, and xoring them would give you the xor of two entirely random things (k1 and k2) which would be completely meaningless.

$\endgroup$
5
  • $\begingroup$ Yes, I did. There is another issue that if the two messages are sent to two parties, then the observer can conclude that the same message is sent to two parties. Generally, I do not upvote OTP answers anymore... $\endgroup$
    – kelalaka
    Jan 27, 2022 at 23:34
  • $\begingroup$ How can they do that? Just assume due to length? $\endgroup$ Jan 27, 2022 at 23:40
  • 1
    $\begingroup$ Of course, that is a general issue that is not considered theoretically, however, exists in practice. For example, CryptDB solved this issue to extend the string to the same size, otherwise, there is a distinction on the database, etc... However, if a new long string is added, it is a hell of a mess... $\endgroup$
    – kelalaka
    Jan 27, 2022 at 23:42
  • $\begingroup$ Yeah, agreed. But if you are sending only two messages then it would be fine to pad both to an arbitrary length. There is no other way to tell the messages are the same. $\endgroup$ Jan 27, 2022 at 23:49
  • 1
    $\begingroup$ That is a solution in this case, in general, this is not as easy as this. $\endgroup$
    – kelalaka
    Jan 27, 2022 at 23:51

Your Answer

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

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