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.

of size n, suppose that p i is the probability of a random character is the i-th character ina string of length N. Then, in the limit as the string length N goes to infinity, the indexof coincidence in that language is:n∑p 2 i .Over an alphabet of 26 characters, the coincidence index of random text is∑26i=1i=1(1/26) 2 = 1/26 ∼ = 0.0385.For English text, the coincidence index is around 0.0661. For a finite string of length N,we the index of coincidence is defined to be:∑ ni=1 n i(n i − 1),N(N − 1)where n i is the number of occurrences of the i-th character in the string.Theorem 3.1 The expected index of coincidence of a ciphertext of length N, output froma period m cipher, which is defined by m independent substitutions ciphers at each positionin arithmetic progression the i + jm, is( )( )1 N − m (m − 1) Nim N − 1 X + i n ,m N − 1where i X is the index of coincidence of the space X, the size of the alphabet is n, and andi n = 1/n is the index of coincidence of random text in that space.Example 3.2 Consider the ciphertext enciphered with a Vigenère cipher:OOEXQGHXINMFRTRIFSSMZRWLYOWTTWTJIWMOBEDAXHVHSFTRIQKMENXZPNQWMCVEJTWJTOHTJXWYIFPSVIWEMNUVWHMCXZTCLFSCVNDLWTENUHSYKVCTGMGYXSYELVAVLTZRVHRUHAGICKIVAHORLWSUNLGZECLSSSWJLSKOGWVDXHDECLBBMYWXHFAOVUVHLWCSYEVVWCJGGQFFVEOAZTQHLONXGAHOGDTERUEQDIDLLWCMLGZJLOEJTVLZKZAWRIFISUEWWLIXKWNISKLQZHKHWHLIEIKZORSOLSUCHAZAIQACIEPIKIELPWHWEUQSKELCDDSKZRYVNDLWTMNKLWSIFMFVHAPAZLNSRVTEDEMYOTDLQUEIIMEWEBJWRXSYEVLTRVGJKHYISCYCPWTTOEWANHDPWHWEPIKKODLKIEYRPDKAIWSGINZKZASDSKTITZPDPSOILWIERRVUIQLLHFRZKZADKCKLLEEHJLAWWVDWHFALOEOQWThe coincidence index of this text is 0.0439. This would suggest a period of approximately5. We will see that this is a bad estimate. Note that this doesn’t disprove the theorem, itjust shows that the statistical errors are too great and that we would need a much largersample size to converge to this theoretical expectation, or that the substitutions employedwere not independent.22 Chapter 3. Elementary Cryptanalysis

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

Saved successfully!

Ooh no, something went wrong!