11.07.2015 Views

Cryptography - Sage

Cryptography - Sage

Cryptography - Sage

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.4 Conditional EntropyWe can now define the conditional entropy H(M|y) of the plaintext space with respect toa given ciphertext y ∈ C.H(M|y) = ∑ x∈MP (x|y) log 2 (P (x|y) −1 )The conditional entropy H(M|C) of a cryptosystem (more precisely, of the plaintext withrespect to the ciphertext) as an expectation of the individual conditional entropies:H(M|C) = ∑ y∈CP (y)H(M|y)This is sometimes referred to as the equivocation of the plaintext space M with respect tothe ciphertext space C.4.5 Perfect secrecy and one-time padsPerfect Secrecy. A cryptosystem is said to have perfect secrecy if the entropy H(M)equals the conditional entropy H(M|C).Let K = k 1 k 2 . . . be a key stream of random bits, and let M = m 1 m 2 . . . be the plaintextbits. We define a ciphertext C = c 1 c 2 . . . byc i = m i ⊕ k i ,where ⊕ is the addition operation on bits in Z/2Z. In the language of computer science,this is the xor operator:0 ⊕ 0 = 0, 1 ⊕ 0 = 1,0 ⊕ 1 = 1, 1 ⊕ 1 = 0.In general such a cryptosystem is called the Vernam cipher. If the keystream bits aregenerated independently and randomly, then this cipher is called a one-time pad.Note that neither the Vernam cipher nor the one-time pad has to be defined with respectto a binary alphabet. The bit operation xor can be replaced by addition in Z/nZ, wheren is the alphabet size, using any bijection of the alphabet with the set {0, . . . , n − 1}.Perfect secrecy of one-time padsRecall that P (x|y) is defined to be P (x|y) = P (x, y)/P (y) if P (y) ≠ 0 and is zero otherwise.If M is the plaintext space and C the ciphertext space (with probability function defined34 Chapter 4. Information Theory

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!