cryptology i.definitions ii.substitution ciphers iii.transpositions ciphers iv.the des algorithm...

28
Cryptology I. Definitions II. Substitution Ciphers III.Transpositions Ciphers IV. The DES Algorithm V. Public-Key Cryptology

Upload: bruno-stanley

Post on 29-Dec-2015

235 views

Category:

Documents


2 download

TRANSCRIPT

Cryptology

I. Definitions

II. Substitution Ciphers

III. Transpositions Ciphers

IV. The DES Algorithm

V. Public-Key Cryptology

Definitions

code – thousands of words, phrases or symbols that form codewords that replace plaintext elements.

cipher – a method of secret writing

cryptography – art of devising ciphers

cryptoanalysis – art of breaking ciphers

cryptology – art of devising & breaking ciphers

Substitution Ciphers

• Monoalphabetic (26! possible ciphers)

– Caesar cipher– Newspaper’s “Daily Cryptoquote”

• Polyalphabetic– Vigenere cipher– Playfair cipher

Caesar Cipher

ABCDEFGHIJKLMNOPQRSTUVWXYZ||||||||||||||||||||||||||DEFGHIJKLMNOPQRSTUVWXYZABC

ATTACK AT DAWNwould be encoded as

DWWDFN DW GDZQ

Ark. Democrat Gazette, Dec. 3, 2001

Newspaper’s Daily Cryptoquote

OGR MWRZNVMD YXMP GMC URRD M CQWUBX BY XNURZOQ MDK YZRRKBW.

Ark. Democrat Gazette, Dec. 3, 2001

Newspaper’s Daily Cryptoquote

OGR MWRZNVMD YXMP GMC URRD M CQWUBX BY XNURZOQ MDK YZRRKBW.

THE AMERICAN FLAG HAS BEEN A

SYMBOL OF LIBERTY AND FREEDOM.

Percentages of the English Language Letters__ Diagrams__ Trigrams__ Words___E 13.05 TH 3.16 THE 4.72 THE 6.42T 9.02 IN 1.54 ING 1.42 OF 4.02O 8.21 ER 1.33 AND 1.13 AND 3.15A 7.81 RE 1.30 ION 1.00 TO 2.36N 7.28 AN 1.08 ENT 0.98 A 2.09I 6.77 HE 1.08 FOR 0.76 IN 1.77R 6.64 AR 1.02 TIO 0.75 THAT 1.25S 6.46 EN 1.02 ERE 0.69 IS 1.03H 5.85 TI 1.02 HER 0.68 I 0.94D 4.11 TE 0.98 ATE 0.66 IT 0.93L 3.60 AT 0.88 VER 0.63 FOR 0.77C 2.93 ON 0.84 TER 0.62 AS 0.76F 2.88 HA 0.84 THA 0.62 WITH 0.76U 2.77 OU 0.72 ATI 0.59 WAS 0.72M 2.62 IT 0.71 HAT 0.55 HIS 0.71P 2.15 ES 0.69 ERS 0.54 HE 0.71Y 1.51 ST 0.68 HIS 0.52 BE 0.63W 1.49 OR 0.68 RES 0.50 NOT 0.61G 1.39 NT 0.67 ILL 0.47 BY 0.57B 1.28 HI 0.66 ARE 0.46 BUT 0.56V 1.00 EA 0.64 CON 0.45 HAVE 0.55K 0.42 VE 0.64 NCE 0.45 YOU 0.55X 0.30 CO 0.59 ALL 0.44 WHICH 0.53J 0.23 DE 0.55 EVE 0.44 ARE 0.50Q 0.14 RA 0.55 ITH 0.44 ON 0.47Z 0.09 RO 0.55 TED 0.44 OR 0.45

Polyalphabetic Substitutions

• Use a different “alphabet” for each letter in the plaintext.

• Defeats attacks based upon common English frequency charts.

Vigenere Cipher

ABCDEFGHIJKLMNOPQRSTUVWXYZBCDEFGHIJKLMNOPQRSTUVWXYZACDEFGHIJKLMNOPQRSTUVWXYZAB Key: COOKIEMONSTERCOOKIEMONSTERDEFGHIJKLMNOPQRSTUVWXYZABC Plaintext: ATTACKATDAWNPLEASEEFGHIJKLMNOPQRSTUVWXYZABCDFGHIJKLMNOPQRSTUVWXYZABCDEGHIJKLMNOPQRSTUVWXYZABCDEF 1. Use key letter to select rowHIJKLMNOPQRSTUVWXYZABCDEFG 2. Use plaintext letter to select columnIJKLMNOPQRSTUVWXYZABCDEFGH 3. Ciphertext letter is found at selected row & columnJKLMNOPQRSTUVWXYZABCDEFGHIKLMNOPQRSTUVWXYZABCDEFGHIJ Ciphertext: CHHKKOMHQSPRGNSOCMLMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKLNOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMNPQRSTUVWXYZABCDEFGHIJKLMNOQRSTUVWXYZABCDEFGHIJKLMNOPRSTUVWXYZABCDEFGHIJKLMNOPQSTUVWXYZABCDEFGHIJKLMNOPQRTUVWXYZABCDEFGHIJKLMNOPQRSUVWXYZABCDEFGHIJKLMNOPQRSTVWXYZABCDEFGHIJKLMNOPQRSTUWXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVWYZABCDEFGHIJKLMNOPQRSTUVWXZABCDEFGHIJKLMNOPQRSTUVWXY

Playfair Cipher

1) Group plaintext into pairs of letters. The letters ‘I’ and ‘J’ areconsidered to be the same letter. If any pair contains identical M B Q Z Aletters insert a ‘Q’. If odd number of letters, add an ‘X’. D R G F S

2) If the 2 letters are in same row, take the pair of letters N H U E Kto the right of the plaintext letters V T L W I

3) If the 2 letters are in the same column, take the pair of O X C P Yof letters below the plaintext letters.

4) If the 2 letters form the corners of a rectangle, Take the 2letters at the opposite corners of the rectangle. The letterin the same row as the first plaintext letter is taken as the first cipher letter.

Plaintext: Now is the time for all good menGrouped: NO WI ST HE TI ME FO RA LQ LG OQ OD ME NXCipher: VM IV RI UK LV ZN DP SB CG CU CM MN ZN HO

Transposition Ciphers

• Railfence Transpositions

• Columnar Transpositions

• Double Transpositions

Railfence Transpositions

Plaintext: IS THIS A GOOD CIPHER

I I O I R

Railfence: S H S G O C P E

T A D H

Ciphertext: IIOIRSHSGOCPETADH

Columnar Transpositions

MEGABUCK

PLEASETR Key determines number of columns.

ANSFERON

EMILLION Ciphertext is written using columns in

DOLLARST alphabetical order of letters in key.

OMYSWISS

BANKACCO Ciphertext: AFLL SKSO SELA WAIA

UNTSIXTW TOOS SCTC LNMO MANT ESIL YNTW

OTWOABCD RNNT SOWD PAED OBUO ERIR ICXB

Double Transpositions

POLITICS MONEY

COMETOTH TTEDR Columns of first matrix are

EAIDOFTH OFYMI entered into the second matrix.

EPARTY AOAPC Columns of second matrix yield

EEHHT the ciphertext.

OT

Plaintext: COME TO THE AID OF THE PARTY

Ciphertext: DMPH TOAEO EYAH TFOET RICT

The DES Algorithm

• Data Encryption Standard was adopted by National Bureau of Standards in 1977

• Plaintext is 1st grouped into blocks of 64 bits

• 56-bit key

• 19 distinct stages

– Initial key independent transposition

– 16 substitution steps using 56-bit key

– Final 2 stages involve more transpositions

• Decryption uses same key with stages in reverse order

The DES Algorithm

56 bit key

Initial Transposition

Iteration 1

Iteration 2

Iteration 16

32 bit swap

Final Transposition

64 bit plaintext

64 bit ciphertext

32 bits 32 bits

Li-1 + f(Ri-1,Ki)

Li-1 Ri-1

Detail of one iteration

The DES Algorithm

• IBM’s original design used 128 bits• U.S. National Security Agency requested

reduction to 56 bits• Reason for change has not been made public• Reasons for particular choices for iteration

functions has remained secret as well• Requires key distribution

The DES Algorithm

• DES has been replaced with Triple DESThis newer version uses a 112-bit key.

• AES (Advanced Encryption Standard)According to the U.S. Commerce Department all federal departments must use AES by May 29, 2002. This should influence commercial use as well. AES was developed by Belgian researchers and is based upon a 128-bit key.

Public-Key Cryptography(The RSA algorithm* is most famous example.)

Relationship between the plaintext and the ciphertext

* Named for developers Rivest, Shamir, and Adleman.

Public-Key Cryptography

Selecting a public key:1) Select 2 distinct primes, p & q (preferably extremely large).2) Form the product, n = p * q.3) Compute = (p-1) * (q-1).4) Select any integer e, with the property that GCD(e,) = 1.

The pair of integers, e and n, comprise the public key.

Example: If p = 3 and q = 11, then n = 33 and = 20. We could choosee = 7, since GCD(7,20) = 1. Thus, our public key would be the pair: e = 7 and n=33.

Public-Key Cryptography

Selecting a private key:Using the value for e and found earlier,

find d such that (e*d) mod = 1.

The pair of integers, d and n, comprise the private key.

Continuing previous example:

Since e = 7 and = 20, d must be 3 (7*3 mod 20 = 1).

Thus, our private key would be the pair: d = 3 and n = 33.

Public-Key Cryptography

Ciphertext is generated using: c = pe mod n.

Text Numeric p7 c = p7 mod 33

S 19 893,871,739 13

U 21 1,801,088,541 21

N 14 105,413,504 20

D 4 16,384 16

A 1 1 1

Y 25 6,103,515,625 31

Ciphertext: 13 21 20 16 01 31

Public-Key Cryptography

Plaintext is recovered using: p = cd mod n.

Numeric c3 c = p3 mod 33 Text

13 2,197 19 S

21 9,261 21 U

20 8,000 14 N

16 4,096 4 D

1 1 1 A

31 29,791 25 Y

Plaintext: SUNDAY

Public-Key Cryptography

• The security is dependent upon the difficulty of finding the prime factors of a very large integer. No efficient algorithm has yet been found.

• Factoring 200 digit integers requires 4.3*106 years.

• Factoring 300 digit integers requires 5.5*1012 years.

• Factoring 500 digit integers requires 4.7*1022 years.

(Assumes a computer that uses 1 nanosecond per instruction.)

Public-Key Cryptography

• E-mail signatures– A encodes his personal ID using his private key– If B can decode the personal ID using A’s

public key, then B knows that A sent message.

C = E(ID,private_keyA) P = D(C, public_keyA)

Public-Key Cryptography

• Encrypted signatures.(1) A encodes personal ID using A’s private key.

(2) A encodes result using B’s public key.

(3) Upon receipt, B decodes by first using B’s private key.

(4) B then verifies signature by decoding using A’s public key.

A’s steps: C = E( E(ID,privateA), publicB) ; Transmit C

B’s steps: Receive C ; P = D( D(C,privateB), publicA)

If P equals A’s ID then B is confident that message came from A;

furthermore A is protected because only B can decode the message.

Public-Key Cryptography

• PGP (Pretty Good Privacy) – Uses Public-Key cryptography

– Used by many to encrypt their e-mail and implement signatures

– Inexpensive (free version available for personal use)

http://www.pgpi.org

http://web.mit.edu/network/pgp.html

http://www.pgp.com

References• The Codebreakers, by David Kahn, 1973.

Excellent account of the history of cryptology with special emphasis during World War II

• Cryptanalysis for Microcomputers, by Caxton C. Foster, 1982.

• Codes, Ciphers, and Computers, by Bruce Bosworth, 1982.

• Computer Networks, Andrew Tanenbaum, 1988.

• Cryptology, NSF Chautauqua Program taught by Robert E. Lewand at Christian Brothers University in Memphis, TN on June 28-30, 1998.