Xmas Cryptanalisys :)
evilcry <evilcrygmailcom> Monday, December 25 2006 04:25.51 CST


First of all, i would give you my best wishes for a Peaceful and Happy Christmas, i've published this post because, as someone already said, "this make me fell alive"

Here i'll talk about the cryptanalysis of a simple Binary Addition, but this can be usefull for people that have some Psion5 PDA file Encrypted ;)

Psion 5 PDA implements a very weak encryption system, here i'll demonstrate how we can obtain a fully clear plaintext from an encrypted block (a Cipher Only Attack).

The algorithm used is a simple Binary Addition:

Encryption phase: The key entered is added character by character (byte by byte) to the data to be encrypted. Here addition modulo 256 is used. The key is applied cyclically, once all bytes of the key have been used, the algorithm reverts to the first character until the text has been completely encrypted.

Decryption phase: The characters of the key have to be subtracted from the encrypted text modulo 256.

As previously said a Cipher Only Attack can be performed, we need to know:

1)Statistical Frequency: The characters which occur most frequently), but if we don't know this parameter, there is no problem, because we can use statistical tables, or at least a small bruteforce it's range is truly small, only 26 as the number of letters, more if we are working with not common languages (xenographyc tables are useful in this case).

2)The key length: We can determine the keylenght using Autocorrelation (which is an index of similarity for differents portions of text).
Each character had not an equal probability occurs, but the probability of two identical characters occurring is relatively large if they are separated by a multiple of the key length. Thanks to the Autocorrelation analisys, we can determine a "distance value", calculated between equal frequency values, this value is our Derived Key Lenght.

3)Discovering The Key: After we know the Key Lenght, throughout the Histogram analisys of every character of the key, we can determine the correct key char. It's important to underline that, in this process we have to assume a Most Common Character,
for example on english texts we can assume the 'e' OR the space ' '.


--------------------[Background Philosophy]----------->

The base concept that allowed this attack, is the The Unicity Distance, which is one of the fundamentals of Cryptanalisys.
The Unicity Distance, is the minimum amount of ciphertext (expressed in number of of chars) required to allow a computationally unlimited adversari to recovery the Encryption Key.

We can express this concept in more strict terms, as No = H(K)/D, where
No=Expected Unicity Distance
H(K)=Entropy of Key Space
D=Plaintext Redundancy (Referred to the Histogram Analisys)

In our case we have to introduce another parameter, t which is the period of our cipher. Assuming D as 3.2 bits/chars we have:

H(K)/D=lg(t!)/3.2

Using Stirling's Approximation we can rewrite the previous as:

t! Approximately Is Sqrt((2Pi*t))* (t/e)^t

As usual i exceded in the Math Back-Ground analysis :)
but reported informations should be enough for people that want to implement some Automatic Cryptanalisys Proggie :)

Again Merry Xmas and see you to the next post ;)


Comments
Posted: Wednesday, December 31 1969 18:00.00 CST