200 likes | 221 Views
Learn about cryptography, keys, algorithms, and systems in this lecture. Explore symmetric and public-key systems, classical cryptography, and practical exercises with encryption algorithms.
E N D
Lecture Goals • To know • What is the cryptography? • What is a key in cryptography system? • What is a symmetric key system? • What is a public key system? • What is the base of the Public-key cryptography? • To exercise simple cryptography algorithms
Cryptography • Definition • The art of secret writing • Objective • To enable two people to communicate over an insecure channel in such a way that opponent cannot understand what is being said
Cryptography • The mostly used tool for securing information and services • Relies on ciphers: mathematical functions used for encryption and decryption of a message • Encryption – the process of disguising a message in such a way as to hide its substance • Ciphertext – an encrypted message • Decryption – the process of returning an ecrypted message back into plaintext
Ciphers • For some message M • Let’s denote • the encryption of that message into cipher text as Ek(M) = C • the decryption into plain text as Dk(C) = M • Notice, • Symmetric-key algorithm Dk(Ek(M)) = M • Public-key algorithm Dk1(Ek2(M))= M
Cryptosystem • Algorithm + Key • The reason for having a key to an algorithm • Difficult to devising new algorithms • Difficult to quickly explain a newly devised algorithm to the person with whom you’d like to start communication securely • A good cryptosystem • Perfectly OK to have everyone know the algorithm • Knowledge of the algorithm withou the key does not help unmangle the information
Classical Cryptography • Transposition cipher • Simple transposition • Substitution cipher • Hill cipher
Simple Transposition • Grouping the plaintext into blocks of t characters • Applying to each block a single permutation on the numbers 1 through t • Encryption • C = E(M) = m(1) …m(t), (M=m1…mt) • Decryption • M = D(C) = E-1(C) = c-1(1) …c-1(t), (C = c1…ct)
Simple Transposition Example • T = 6, = (6 4 1 3 5 2) • M = CAESAR • m1 = C, m2 = A, m3 = E, m4 = S, m5 = A, m6 = R • C = m6m4m1m3m5m2 = RSCEAA • Exercise • C = OPCYTRYPGAHR , M = ? -1 = (3 6 4 2 5 1) M = D(C) = D({OPCYTR})D({YPGAHR}) = CRYPTOGRAPHY
Hill Cipher • An invertible m x m matrix K as the key representing a system of linear equations • 1 x m matrices as Ciphertext, C, and plaintext, P • Encryption • C EK(P) PK (mod n) • Decryption • P DK(C) CK-1 (mod n)
(mod 26) Hill Cipher Example • K = • P = (5 17) C PK (15 16) (mod 26) • Exercise • Decryption ?
Public Key Cryptography • Problem with symmetric key algorithms • A secure method of telling your partner the key • A separate key for everyone you might communicate with • Public-Key algorithms use a public-key and private-key pair over a message
Public Key Cryptography Encryption
Public Key Cryptography Authentication
RSA Public-key encryption • Proposed by Rivest, Shamir, and Adleman in 1977 • Mostly widely used public-key cryptosystem • The security is based on the intractability of the integer factorization problem
RSA Public Key Cryptography Key Generation • Generate two large random primes p and q. • Compute n = pq and = (p-1)(q-1). • Select a random integer e, 1 < e < , such that gcd(e, ) = 1. • Compute the unique integer d, 1 < d < , such that ed 1 (mod ). Public key : (n, e) Private key : d
RSA Public Key Cryptography Encryption • Bob encrypts a message m for Alice • Obtain Alice’s public key (n, e) • Represent the message as an integer m in the interval [0, n-1] • Compute C Me (mod n) • Alice recovers plaintext m from c as follows: • M Cd (mod n)
RSA Public Key Cryptography Theorem: C Md (mod n) • Proof C d (Me)d (mod n) Med (mod n) Mk+1 (mod n) MMk (mod n) MMk(p-1)(q-1) (mod n) M (mod n)
RSA Public Key Cryptography Example • p = 2357, q = 2251 • n = pq = 6012707, = (p-1)(q-1) = 6007800 • Choose e = 3674911, then d = 422191 • Public key (n = 6012707, e = 3674911) • Private key d = 422191 • Plaintext m = 5234673 C = me mod n = 52346733674911 mod 6012707 = 3650502
RSA Public Key Cryptography Exercise • Public key (119, 5), private key d = 77 • Plaintext M = 19 • Ciphertext C = ? • What about manual decryption ?