190 likes | 638 Views
Cryptography: Basic Concepts. Plaintext: message text M to be protected Ciphertext: encrypted plaintext C Key: A secret shared by sender and recipient Encryption: a mathematical transformation E of a plaintext into a cipher text using key K E(plaintext, K) = ciphertext E(M, K) = C
E N D
Cryptography: Basic Concepts • Plaintext: message text M to be protected • Ciphertext: encrypted plaintext C • Key: A secret shared by sender and recipient • Encryption: a mathematical transformation E of a plaintext into a cipher text using key K • E(plaintext, K) = ciphertext • E(M, K) = C • Decryption: recovery of the plaintext from the ciphertext • D(C, K) = M • Key concept: • encryption should be computationally easy • decryption should be computationally easy if you have the key K and very difficult without K • Work factor: • a measure of the time to recover M from C in the absence of K
Early Encryption Caesar code All letters increased by the same amount. E(POLICY) = P O L I C Y + 2 = R Q N K E A One-to-one mapping for all letters ABCDEFGHIJKLMNOPQRSTUVWXYZ YMZKDBSQIHEAGRNWTFCJLVXUOP Add a different number to each letter. E(CODE) = C O D E +25 +23 +4 +1 = B L H F
Public Key Encryption • A user creates two keys SK and PK which are mathematically related. • The public key, PK, is made widely available. • C = E(M, SK) • A user’s private key SK is not divulged to anyone • To send a message to a user, you encrypt it with his public key • C = E(M, PK) • Only the recipient has the private key which can decrypt the message • M = D(C, SK)
Public Key Encryptionusing RSA • Choose large prime numbers p, q. • Choose e, d such that e*d mod (p-1)(q-1) = 1. • e relatively prime to (p-1)(q-1) • Encode: C = E(M) = Me mod (pq) • Decode: M = E(C) = Cd mod (pq) • Public: e and p*q • Private: d • To find d from e and pq, you must factor p*q, to find (p-1)(q-1). • finding prime factors is a hard problem. • Encryption and Decryption are commutative” • E(D(M) = D(E(M) e d
Using Public Keys for Signatures • Given a Message M, computer a Message Digest, H(M) • Encrypt H(M) using the Private key of the sender • D(H(M)) • Send M, D(H(M)) • The recipient uses sender’s public key to verify signature • If E(D(H(M))) matches H(M) computed on the received message, then: • the message must have been signed by the sender, • only the sender knows D • it has not been altered. • infeasible to create an altered message which computes to the same H(M)