370 likes | 1.18k Views
Information and Network Security. Ch 5: Public-key Cryptography. Outlines. Principles of Public-Key Cryptography The RSA Algorithm. Classical Cryptography: Secret-Key or Symmetric Cryptography. Alice and Bob agree on an encryption method and a shared key .
E N D
Information and Network Security Ch 5: Public-key Cryptography
Outlines • Principles of Public-Key Cryptography • The RSA Algorithm
Classical Cryptography:Secret-Key or Symmetric Cryptography • Alice and Bob agree on an encryption method and a shared key. • Alice uses the key and the encryption method to encrypt (or encipher) a message and sends it to Bob. • Bob uses the same key and the related decryption method to decrypt (or decipher) the message.
Advantages of Classical Cryptography • There are some very fast classical encryption (and decryption) algorithms • Since the speed of a method varies with the length of the key, faster algorithms allow one to use longer key values. • Larger key values make it harder to guess the key value-- and break the code -- by brute force.
Disadvantages of Classical Cryptography • Requires secure transmission of key value • Requires a separate key for each group of people that wishes to exchange encrypted messages (readable by any group member) • For example, to have a separate key for each pair of people, 100 people would need 4950 different keys.
Public-Key Cryptography: Asymmetric Cryptography • Alice generates a key value (usually a number or pair of related numbers) which she makes public. • Alice uses her public key (and some additional information) to determine a second key (her private key). • Alice keeps her private key (and the additional information she used to construct it) secret.
Public-Key Cryptography (continued) • Bob (or Carol, or anyone else) can use Alice’s public key to encrypt a message for Alice. • Alice can use her private key to decrypt this message. • No-one without access to Alice’s private key (or the information used to construct it) can easily decrypt the message.
An Example: Internet Commerce • Bob wants to use his credit card to buy some brownies from Alice over the Internet. • Alice sends her public key to Bob. • Bob uses this key to encrypt his credit-card number and sends the encrypted number to Alice. • Alice uses her private key to decrypt this message (and get Bob’s credit-card number).
Internet Commerce (continued) • Bob wants to order brownies from Alice and keep the entire transaction private. • Bob sends Alice his public key. • Alice generates a session key, encrypts it using Bob’s public key, and sends it to Bob. • Bob uses the session key (and an agreed-upon symmetric encryption algorithm) to encrypt his order, and sends it to Alice.
Historical Background • 1976: W. Diffie and M.E. Hellman proposed the first public-key encryption algorithms -- actually an algorithm for public exchange of a secret key. • 1978: L.M Adleman, R.L. Rivest and A. Shamir propose the RSA encryption method • Currently the most widely used
Public-Key Encryption Process • Each end system generates a pair of keys (KR, KU). • Each system publishes KU while KR kept secret. • When system A wishes to send a message to B, it uses public-key (KU) of B system to encrypt the message. • When B receives the message it decrypts it using its own private key (KR).
The RSA Encryption Algorithm • RSA is a cryptographic algorithm that met the requirements for public-key systems. • RSA was developed by Ron Rivest, Adi Shamir, and Len Adleman. • It is the most widely accepted and implemented general-purpose approach to public-key encryption.
RSA (continued) • The algorithm makes use of an expression with exponentials. • Key Generation KU = {e, n} KR = {d, n} • Encryption C = M (mod n) • Decryption M = C (mod n) e d
RSA Algorithm Key Generation • Select two prime numbers p=7, q=17 • calculate n =pq = 119 • Calculate Q(n) = (p-1)(q-1) = 96 • Select e such that is relatively prime to Q(n) = 96, in this case e = 5 because the Greatest Common Divisor (GCD) for (96) and (5) is (1) • Determine d such that d*e mod Q(n) = 1 and d< 96, the correct value is d = 77 because 77 x 5 = 385 = 4 x 96 + 1.
RSA Algorithm Encryption • The plain-text = 19, KU = {5, 119} • C = M (mod n) • C = 19 mod 119 = 2476099 mod 119 = 20807 with remainder of 66. • C = 66 • then the cipher-text is 66 e 5
RSA Algorithm Decryption • The cipher-text = 66, KR = {77, 119} • M = C (mod n) • M = 66 mod 119 = 1.27…10 mod 119 = 1.06…10 with a remainder of 19. • M = 19 • then the plain-text is 19 d 77 140 138
Applications of Public-Key Cryptosystem • Encryption/decryption: The sender encrypts a message with the recipient’s public key. • Digital signature: The sender signs a message with its private key • Key exchange: Two sides cooperate to exchange a session key.
Conventional Encryption Vs. Public-Key Encryption • Needed to work: • 1 – One algorithm is used for encr. And decr. with pair of keys, one for encr.and one for decr. • 2 – the sender and receiver must each have one of the matched pair of keys. • Needed for security: • 1 – one of the two keys must be kept secret. • 2 – it must be impractical to decipher a message if no other information is available. • 3 – Knowledge of the algorithm plus one of the keys plus samples of ciphertext must be insufficient to determine the • other key • Needed to work: 1 – the same algorithm with the same key is used for encryption and decryption. 2 – the sender and receiver must share the algorithm and key. • Needed for security: 1 – the key must be kept secret. 2 – it must be impractical to decipher a message if no other information is available. 3 – Knowledge of the algorithm plus samples of ciphertext must be insufficient to determine key.