Top Banner

Click here to load reader

Cryptography & Network Security By, Er. Swapnil Kaware

Jan 17, 2015

ReportDownload

Education

 

2. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Key is shared by both sender and receiver if the key is disclosed communications are compromised also known as symmetric, both parties are equal hence does not protect sender from receiver forging a message & claiming is sent by sender .CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 3. Public-Key Cryptography Probably most significant advance in the 3000 year history of cryptography uses two keys a public key and a private key asymmetric since parties are not equal uses clever application of number theory concepts to function complements rather than replaces private key cryptographyCNS Notes by, Er. Swapnil V. Kaware ([email protected]) 4. Public-Key Cryptography public-key/two-key/asymmetric cryptography involves the use of two keys: a public-key, which may be known by anybody, and can be used to encrypt messages, and verify signatures a private-key, known only to the recipient, used to decrypt messages, and sign (create) signatures is asymmetric because those who encrypt messages or verify signatures cannot decrypt messages or create signaturesCNS Notes by, Er. Swapnil V. Kaware ([email protected]) 5. Public-Key CryptographyCNS Notes by, Er. Swapnil V. Kaware ([email protected]) 6. Why Public-Key Cryptography? developed to address two key issues: key distribution how to have secure communications in general without having to trust a KDC with your key digital signatures how to verify a message comes intact from the claimed sender public invention due to Whitfield Diffie & Martin Hellman at Stanford U. in 1976 known earlier in classified community CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 7. Public-Key Characteristics Public-Key algorithms rely on two keys with the characteristics that it is: computationally infeasible to find decryption key knowing only algorithm & encryption key computationally easy to en/decrypt messages when the relevant (en/decrypt) key is known either of the two related keys can be used for encryption, with the other used for decryption (in some schemes)CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 8. Public-Key CryptosystemsCNS Notes by, Er. Swapnil V. Kaware ([email protected]) 9. Public-Key Applications can classify uses into 3 categories: encryption/decryption (provide secrecy) digital signatures (provide authentication) key exchange (of session keys) some algorithms are suitable for all uses, others are specific to oneCNS Notes by, Er. Swapnil V. Kaware ([email protected]) 10. Security of Public Key Schemes like private key schemes brute force exhaustive search attack is always theoretically possible but keys used are too large (>512bits) security relies on a large enough difference in difficulty between easy (en/decrypt) and hard (cryptanalyse) problems more generally the hard problem is known, its just made too hard to do in practise requires the use of very large numbers hence is slow compared to private key schemes CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 11. Diffie-Hellman The DiffieHellman (DH) key exchange technique was first defined in their seminal paper in 1976. DH key exchange is a method of exchanging public (i.e. non-secret) information to obtain a shared secret. DH is not an encryption algorithm.DH key exchange has the following important properties: 1. The resulting shared secret cannot be computed by either of the parties without the cooperation of the other. 2. A third party observing all the messages transmitted during DH key exchange cannot deduce the resulting shared secret at the end of the protocol. CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 12. Principle behind DH DH key exchange was first proposed before there were any known public key algorithms, but the idea behind it motivated the hunt for practical public key algorithms.DH key exchange is not only a useful and practical key establishment technique, but also a significant milestone in the history of modern cryptography. DH key exchange assumes first that there exists: 1. A public key cipher system that has a special property (we come to this shortly). 2. A carefully chosen, publicly known function F that takes two numbers x and y as input, and outputs a third number F(x,y) (for example, multiplication is such a function). CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 13. Principle behind DH Assume that Alice and Bob are the parties who wish to establish a shared secret, and let their public and private keys in the public key cipher system be denoted by (PA , SA) and (PB , SB) respectively.The basic principle behind DiffieHellman key exchange is as follows: 1. Alice and Bob exchange their public keys PA and PB. 2. Alice computes F(SA , PB)3. Bob computes F(SB, PA) 4. The special property of the public key cipher system, and the choice of the function F, are such that F(SA , PB) = F(SB, PA). If this is the case then Alice and Bob now share a secret.5. This shared secret can easily be converted by some public means into a bitstring suitable for use as, for example, a DES key. CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 14. Diffie-Hellman key exchange The most commonly described implementation of DH key exchange uses the keys of the ElGamal cipher system and a very simple function F.The system parameters (which are public) are: a large prime number p typically 1024 bits in length a primitive element g a 1. Alice generates a private random value a, calculates g (mod p) and sends it to Bob. Meanwhile Bob generates a private random b value b, calculates g (mod p) and sends it to Alice. b2. Alice takes g and her private random value a to compute b a ab (g ) = g (mod p). a3. Bob takes g and his private random value b to compute a b ab (g ) = g (mod p). ab4. Alice and Bob adopt g(mod p) as the shared secret.CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 15. Diffie-Hellman Based on a special case of the subset-sum, or knapsack, problem2011 8 56 4Subset-sum ProblemCNS Notes by, Er. Swapnil V. Kaware ([email protected]) 16. Diffie-Hellman Example Block cipher Block size of 7 bits. Possible 27 combinations Private key (a1, a2, , an) of 7 integers: (1, 2, 5, 11, 32, 87, 141) Chose two special integers, w and m, such that w and m are relatively prime, meaning gcd(w,m) = 1: w = 901, m = 1234 Public key (a1, a2, , an) of 7 integers using the equation: ai = w * ai mod m: (901, 568, 803, 39, 450, 645, 1173) Partition SECRET into 7 bit blocks each block consisting of xn bits (x1, x2, , xn) S 1010011E 1000101C 1000011R 1010010E 1000101T 1010100n Bx = xiai i=1 S = 1 X (901) + 0 X (568) + 1 X (803) + 0 X (39) + 0 X (450) + 1 X (645) + 1 X (1173) S = 3522CNS Notes by, Er. Swapnil V. Kaware ([email protected]) 17. Diffie-Hellman Example Encrypted blocks Bx received. Special version of subset-sum problem Which subset of (a1, a2, , an) sums to Bx where Bx = Bx * w-1 mod m w-1 is the modular inverse of w for m, w * w-1 mod m = 1 Bx = 3522 X (901)-1 mod 1234 Bx = 3522 X 1171 mod 1234 Bx = 234 1. sum 0 2. for i = n step -1 until 1 do if ai + sum