Recurrence test for an encryption algorithm

The recurrence test is used to measure the randomness and to estimate the correlation among the data by consideing the variation between the received encrypted bytes S(t) and the delay version of it for t >=1 (S(t+1)).
How can we implemnet it uisng Matlab?

4 Comments

That depends on the implementation of the algorithm in question.
Well, the point is that it does not depend upon the implementation of the encryption algorithm, beyond that fact that you get a vector of values from a call to the encryption algorithm.
The question could probably be rephrased in terms of the input being a vector of bytes, and the question being to determine whether there is a delay d such that S(t) vs S(t+d) is more highly correlated than would be expected.
You could perhaps use xcorr if you are just looking for bytes being repeated exactly, but a more serious test would look for other patterns as well. For example, if 90% of the time, S(t+d) = xor(S(t),255) + 2 then you would want to know that.
I partly agree with you. You can even use a truly aweful hashing algorithm (like e.g. mine) as an encryptions algorithm, but the main point is still that you will have to figure out a way to shift the signal, and the most optimal way to do that probably depends on what data type the implementation will accept.
The question specifically talks about received encrypted bytes. As it seems unlikely that the person asking the question is a relic of the 1970s and early 1980s when "byte" had not yet been standardized as being the same as octet, we can be nearly certain that the datatype that will be returned will be uint8 (or double being used to represent uint8)
The question as phrased does not require any calls to the encryption algorithm, just analysis of a sequence of bytes. The question is not phrased as being an effort to find some input sequence that has an unusual correlation of bytes in output -- after all, if it is a "good" encryption algorithm, every possible sequence of output bytes is possible, including just happening to produce all 0 or all 42 or producing 0:255 in sequence.

Sign in to comment.

Answers (0)

Categories

Asked:

on 1 Dec 2020

Commented:

on 2 Dec 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!