Cryptography
Cryptography
Cryptography
Outline
Why study cryptology? Basic terms, notations and structure of cryptography Private & public key cryptography examples Modern secret key ciphers : usage and methodology Encryption and possible attacks Secret key ciphers design Slides 23 to 26 for additional information (and reading)
2
Intruder
Communications security
Customer
Merchant
TTP
LEA
Law enforcement
Alice and Bob are Friends Marvin is a rival Alice wants to send secret messages (M1,M2,) to Bob over the Internet Rival Marvin wants to read the messages (M1,M2,) - Alice and Bob want to prevent this! Assumption: The network is OPEN: Marvin is able to eavesdrop and read all data sent from Alice to Bob. Consequence: Alice must not send messages (M1,M2,) directly they must be scrambled or encrypted using a secret code unknown to Marvin but known to Bob. CSE2500 System Security and Privacy
Cryptography
plaintext (data file or messages)
encryption
Encryption
Decryption
Alice
E
key
Bob
Message (cleartext,plaintext)
Basic terms
Cryptology (to be very precise) Cryptography --- code designing Cryptanalysis --- code breaking Cryptologist: Cryptographer & cryptanalyst Encryption/encipherment Scrambling data into unintelligible to unauthorised parties Decryption/decipherment Un-scrambling
Types of ciphers
10
Examples of Messages
Types of secret Messages Alice might want to send Bob (in increasing length):
Decision (yes/no), eg. as answer to the question Are we meeting tomorrow? Numerical Value, eg. as answer to the question at what hour are we meeting? Document Software, Images etc.
11
Concepts
The same key K is used for encryption & decryption K has to be distributed beforehand
12
Notations
Encrypt a plaintext P using a key K & an encryption algorithm E C = E(K,P) Decrypt a ciphertext C using the same key K and the matching decryption algorithm D P = D(K,C)
15
An example
For a key K=3, plaintext letter: ABCDEF...UVWXYZ ciphtertext letter: DEF...UVWXYZABC Hence TREATY IMPOSSIBLE is translated into WUHDWB LPSRVVLEOH
16
17
frequency distributions of letters letter percent A 7.49% B 1.29% C 3.54% D 3.62% E 14.00% ..................................
CSE2500 System Security and Privacy 18
Assume that a message is broken into 64-bit blocks and each 64-bit block of plaintext is encrypted separately: Key space are combinations of numerical digits max: 7 digits (eg: key = [1]; or key = [1,3], or key = [1,4,2]).
Assume that all 8 bits of a byte is used and key digits start from left to right. Encryption: Each plaintext block is first shifted by the number of binary digits before the last non-zero digit of the key. It is then exclusive-ored with the key starting from the first byte of the block, repeatedly to the end of the block (the key moves a distance of its size from left to right of the plaintext block). Decryption: do the reverse of encryption: the cipher-text is exclusive-ored and then shifted.
0 1 0 1
CSE2500 System Security and Privacy
0 1 1 0
= = = =
0 0 1 1
: exclusive or
19
Using TPC
Use TPC to encrypt the plaintext 12345, key = [1,4,2] Use TPC to encrypt the plaintext TREATY IMPOSSIBLE; key = [4]; Use TPC to encrypt the plaintext 100 dollars, key = [2,4];
20
21
Definition: The multiplicative inverse of x with modulo n is y such that (x*y) mod n = 1 E.g:x=3; n=10, => y=7; since (3*7) mod 10 = 1 The above multiplicative inverse can be used to create a simple public key cipher: either x or y can be thought of as a secret key and the other is the public key. Let x = 3, y = 7, n = 10, and M be the message: M = 4 ;
3*4 mod 10 = 2; (ciphertext) - encrypting 2*7 mod 10 = 4 = M ; (message) - decrypting
M =6 ;
3*6 mod 10 = 8; 8*7 mod 10 = 6 = M (message)
22
23
Fair exchange
Contract signing
Anonymity
Electronic cash Electronic voting
Etc.
24
25
There are two general encryption methods: Block ciphers & Stream ciphers Block ciphers
Slice message M into (fixed size blocks) m1, , mn
Add padding to last block
Use Ek to produce (ciphertext blocks) x1, , xn Use Dk to recover M from m1, , mn E.g: DES, etc.
Stream ciphers
Generate a long random string (or pseudo random) called one-time pad. Message
E.g: EC4
26
The security of a cryptographic algorithm depends on how much work it takes for someone to break it
E.g If it takes 10 mil. years to break a cryptographic algorithm X using all the computers of a state, X can be thought of as a secure one reason: cluster computers and quantum computers are powerful enough to crack many current cryptographic algorithms.
27
28
4 types of cryptanalysis
Depending on what a cryptanalyst has to work with, attacks can be classified into
ciphertext only attack known plaintext attack chosen plaintext attack chosen ciphertext attack (most severe)
29
4 types of attacks
30
4 types of attacks
31