Docsity

Cryptography: Ten Puzzling Problems with Cryptograms and Cipher Solutions, Slides of Computer Science

Partial preview of the text

Download Cryptography: Ten Puzzling Problems with Cryptograms and Cipher Solutions and more Slides Computer Science in PDF only on Docsity!

Cryptography

Ten Puzzling Problems in Computer Engineering

Puzzles and Cryptograms in Archeology

Some Simple Cryptograms

Cipher: YHPARGOTPYRC OT EMOCLEW

Plain:

Cipher: EHT YPS WSI RAE GNI LBA CEU TAO

Plain:

WELCOME TO CRYPTOGRAPHY

THE SPY ISW EAR ING ABL UEC OAT

Cipher: ICCRAANCTKBEEDLTIHEIVSECYOODUE

Plain:

I C A N T B E L I E V E Y O U

C R A C K E D T H I S C O D E

Cipher: SSA PSE TJX SME CRE STO THI GEI

Plain:

--- --- --- --- --- --- --- --- THI

Key: 7 4 1 8 6 2 5 3

SME SSA GEI STO PSE CRE TJX

Cipher: AMY TAN’S TWINS ARE CUTE KIDS

Plain: A T T A C K

Simple Substitution Ciphers

Decipher the following text, which is a quotation from a famous scientist. Clue: Z stands for E

“CEBA YUC YXSENM PDZ SERSESYZ, YXZ QESOZDMZ PEJ XQKPE MYQGSJSYA, PEJ S’K ECY MQDZ PLCQY YXZ RCDKZD.” PBLZDY ZSEMYZSE

“CEBA YUC YXSENM PDZ SERSESYZ, YXZ QESOZDMZ PEJ XQKPE

MYQGSJSYA, PEJ S’K ECY MQDZ PLCQY YXZ RCDKZD.”

PBLZDY ZSEMYZSE

“ E E E E E

E E E .”

ALB RT E E INST INE

“ NL T T IN S AR IN INIT , T NI RS AN AN

ST I IT , AN I’ N T S R AB T T R R.”

X stands for H?

H H H

H

O Y WO G F U V D UM

UP D Y D M O U OU FO M

Contextual information facilitated the deciphering of this example

The Pigpen Cipher

Encoded message:

T H I S I H S

S S S

This is a substitution cipher, with all the weaknesses of such ciphers

The German Enigma Encryption Machine

(1) W pressed on keyboard

Q W E R T Z U I O A S D F G H J K P Y X C V B N M L

(2) Battery now connected to W on plugboard...

(3)... which is wired to X plug

(4) Connection goes through the 3 rotors, is “reflected”, returns through the 3 rotors, leads to plugboard

(5) Eventually, the “I” light is illuminated

Source: http://www.codesandciphers.org.uk/enigma/index.htm

Entry disk

Reflector Three rotors

Light array

Keyboard

Plugboard

Alan Turing and the Enigma Project

Source: http://www.ellsbury.com/enigmabombe.htm

The Mansion at Bletchley Park (England’s wartime codebreaking center)

Alan M. Turing 1912-

The German Enigma encryption machine

Enigma’s rotor assembly

Decoding a Key-Based Cipher

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Agreed upon secret key: freshman

09 14 07 13 18 12 08 19 07 Secret key: f r e s h m a n f 05 17 04 18 07 12 00 13 05 Sum: 14 31 11 31 25 24 08 32 12 Modulo 26 sum: 14 05 11 05 25 24 08 06 12 Cipher text: O F L F Z Y I G M

Decipher the coded message and provide a reply to it using the same key

Cipher text: B Y E L P E Y B Z I R S T Q 01 24 04 11 15 04 24 01 25 08 17 18 19 16 Secret key: f r e s h m a n f r e s h m 05 17 04 18 07 12 00 13 05 17 04 18 07 12 Difference: Modulo 26 diff.: Plain text:

Reply: J O H N S M I T H

-4 07 00 -7 08 -8 24 -12 20 -9 13 00 12 04 22 07 00 19 08 18 24 14 20 17 13 00 12 04 W H A T I S Y O U R N A M E

Key-Based Cipher with Binary Messages

Agreed upon secret key (11 bits): 0 1 0 0 0 1 1 1 0 1 0

07 = H 04 = E 24 = Y

15 = P 25 = Z 28 =

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 *** & # @ % $** 26 27 28 29 30 31

Secret key: 0 1 0 0 0 1 1 1 0 1 0 0 1 0 0

XOR: 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0

Plain text: 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0

Secret key: 0 1 0 0 0 1 1 1 0 1 0 0 1 0 0

XOR: 0 1 1 1 1 1 1 0 0 1 1 1 1 0 0

(mod-2 add)

Symmetric: Encoding and decoding algorithms are the same

Use of Backdoors in Cryptography

f –

f ( x ) x

f

x f ( x )

Plaintext Cipher

Complicated transformation

Inverse function

is a backdoor...

Like a hidden latch that releases

a magician’s handcuffs

Public-Key Cryptography Alice

Bob

Alice

Encryption and decryption are asymmetric. Knowledge of the public key does not allow one to decrypt a message. Alice

Bob

Bob

Alice

Electronic signature (authentication)

Source: Wikipedia

E.g., key for symmetric communication

RSA Public Key Algorithm

Security of RSA is due to the difficulty of factoring large numbers Therefore, p and q must be very large: 100s of bits

Choose large primes p and q Compute n = pq Compute m = ( p – 1)( q – 1) Choose small e coprime to m Find d such that de = 1 mod m Publish n and e as public key Keep n and d as private key

Encryption example:

y = xe^ mod n = 6^5 mod 133 = 7776 mod 133 = 62

p = 7, q = 19 n = 7 × 19 = 133 m = 6 × 18 = 108 e = 5 d = 65 Public key: 133, 5 Private key: 133, 65

Decryption example:

x = yd^ mod n = 62^65 mod 133 = 62(3844)^32 mod 133 = 62(120)^32 mod 133 = ... = 6