A
A
AUN2015-01-21 23:27:02
Programming
AUN, 2015-01-21 23:27:02

Cracking the Vernam cipher (one-time pad). How to do?

Hey!
There are several ciphertexts in hex, where Ci is the ciphertext, Mi is the message, K is the key, Ci= Mi xor K.
if you make xor between C1 xor C2= M1 xor M2. And how can you get the key in the end?
It seems to have something to do with entropy. as?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Kudryavtsev, 2015-01-22
@kumaxim

I know of only one method of opening such systems...
Link 1 | Link 2

M
Mrrl, 2015-01-22
@Mrl

We assume that we know what language the messages are in, and the statistics of the distribution of characters (as well as combinations of 2, 3 characters ...)
Depends on how many messages we have.
If there are enough of them, then we build the statistics of the symbol with each serial number over all messages (the symbol k has occurred P[k] times). This statistic should be obtained from the standard L statistic for the language as P[k]=L[k^c], where c is the character being searched for. For each c, we calculate the probability that it was he who ended up in this place, and then we begin to look for the most probable text for some message.
If there are only two messages, then you will have to use the distribution of character groups, see which combinations will most likely result in a fragment from C1 ^ C2, and then unravel them using some Markov chains. I don't know if it will work.
It will make things a lot easier if the messages are fragments of ordinary ASCII files, with all punctuation marks and newlines. You can use the fact that the line feed has the code 0D,0A, the space - 20, other punctuation marks - from 21 to 3F, large letters - from 41 to 5A, small letters - from 61 to 7A (this is if the text is English. For Russian, even better ). We look at the behavior of bits 40 and 20. If in some place in different encoded messages the values ​​of bit 40 are different, then in some it is a letter, in the rest it is a punctuation mark. Moreover, the letter is more likely in those in which the meaning is more frequent. After a little tweaking, we get the division of texts into words, lines and sentences. At the same time, some letters appear in some of the messages. Then we work with the distribution of one-, two- and three-letter words. Maybe it will.

R
Rsa97, 2015-01-22
@Rsa97

Correctly encoded by the Vernam cipher (the length of the gamma is not less than the length of the message; the gamma is obtained randomly, not pseudo-randomly; the gamma is used only once) the message is not decoded in principle, it is proved mathematically. This cipher is considered the most secure in cryptography.
Think for yourself, from one original message "АААААААААААААА" using different scales you can get "Welcome!" and "Entry denied!!!".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question