The unicity distance can equivalently be defined as the minimum amount of ciphertext required to permit a computationally unlimited adversary to recover the unique encryption key. The expected unicity distance can then be shown to be: : U = H(k) / D where
U is the unicity distance,
H(
k) is the entropy of the key space (e.g. 128 for 2128 equiprobable keys, rather less if the key is a memorized pass-phrase).
D is defined as the plaintext redundancy in bits per character. Now an alphabet of 32 characters can carry 5 bits of information per character (as 32 = 25). In general the number of bits of information per character is , where
N is the number of characters in the alphabet and is the
binary logarithm. So for English each character can convey bits of information. However the average amount of actual information carried per character in meaningful English text is only about 1.5 bits per character. So the plain text redundancy is
D = 4.7 − 1.5 = 3.2. Basically the bigger the unicity distance the better. For a one time pad of unlimited size, given the unbounded entropy of the key space, we have U = \infty, which is consistent with the
one-time pad being unbreakable.
Unicity distance of substitution cipher For a simple
substitution cipher, the number of possible keys is , the number of ways in which the alphabet can be permuted. Assuming all keys are equally likely, bits. For English text , thus . So given 28 characters of ciphertext it should be theoretically possible to work out an English plaintext and hence the key. ==Practical application==