Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 4 - Cryptography

Similar presentations


Presentation on theme: "Lecture 4 - Cryptography"— Presentation transcript:

1 Lecture 4 - Cryptography
2018/12/31 Y K Choi Lecture 4 - Cryptography Contents Review Public Key Cryptography Message Digest Digital Envelope Certifying Authorities Securing Private Keys – p23 – 34, web security

2 Review of Asymmetric Cryptography (Public Key Infrastructure)
Use two keys – public and private keys to perform encryption and decryption. 2018/12/31 Y K Choi

3 Message Digest Functions
Message digest means: Authentication without Encryption Sometimes we only want authentication, but do not care about message encryption Example: Message broadcast from an authorized source. (You receive a message (message content is not important, see whether you will go home to have your dinner) from your father. How do you know that it is really from your father?) Solution: use message digest (MD) 2018/12/31 Y K Choi

4 Procedure of Message Digest
Use a secure (one-way) hash function to compute a fixed-size tag, called a message digest for a given message M concatenated (means append) with a shared secret value between two communicating parties A and B. Sign the hash with the sender’s private key Send the signed hash (hash after encryption) and the original message (not encrypted or encrypted) to the recipient The recipient now decrypts the hash using sender’s public key and compares with the result of running the message through the digest function. Original Message Tag (message digest) Send from A to B including the message and tag 2018/12/31 Y K Choi

5 Explanation – if Equal then correct
2018/12/31 Y K Choi

6 Example of Message Digest- original message is not encrypted in this example
encrypted with private key Message digest Signed hash Original message Signed hash send out 2018/12/31 Y K Choi

7 Type of Message Digest Function
MD2: (message digest type 2) The algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. MD4: Developed by MIT and was found to have a minor weakness after release MD5: As a replacement of MD4 SHA: Secure Hash Algorithm and produces a 160-bit hash. No need to memorise 2018/12/31 Y K Choi

8 Digital Envelopes There is a drawback for public key encryption: it is slower when compared to symmetric system and is not suitable for transferring large document. The solution is: to combine two (symmetric and asymmetric) together symmetric systems: fast but insecure as the same key is used to encrypt and decrypt Asymmetric symmetric: it is secure and is used to encrypt and decrypt the session key which is randomly generated prior to encrypting the message 2018/12/31 Y K Choi

9 Send both the ciphertext and digital envelope
2018/12/31 Y K Choi

10 Digital Envelope Generate a secret key at random. This random key is called session key (last for one session) Encrypt the plaintext with the session key Encrypt the session key with recipient’s public key called digital envelope Send both to the remote recipient Remote will use its private key to decrypt the digital envelope to recover the session key Use the session key to decrypt the message 2018/12/31 Y K Choi

11 Certifying Authorities and the Public Key Infrastructure
The public key cryptography works well only the sender knows the recipient’s public key. You can image the problem. If you have 100 recipients, you have to keep a small database of the 100’s public keys in your PC or ask the recipient to send you the public key. You have to update any changes later as well. 2018/12/31 Y K Choi

12 Problem of asking the recipients’ public key
There is a problem to keep a database in your hard disk, as we are talking over 100, 1000 or even more web sites. It is difficult to update the changes as well. Say, the recipients’ public key is changed, the server has to inform those that need service over the Internet. There is no assurance whether the remote is actually the one you want. (this is related to authentication) 2018/12/31 Y K Choi

13 The solution – uses Certifying Authorities
A certifying authority (CA) is a commercial enterprise for public key validation. In Hong Kong, the CA is the post office. The role is to vouch for the identities of individuals and organisations. (For example, one of the purposes of writing up a recommendation (for further studies) by a lecturer is to vouch (identify) the applicant.) In this case, the sender does not need to keep the database of recipients’ keys, but a few Public Keys of trusted CAs. 2018/12/31 Y K Choi

14 How CA works? It is also called the public key infrastructure
HKSAR is a CA of issuing the Hong Kong Identity card that you trust. If a card is issued by a company called ABC, will you trust this card? 2018/12/31 Y K Choi

15 CA works as follows Generate a public/private key pair by individual
Keep the private key and send the public key to CA with identification (such as your name etc.) CA will now verify the identity of sender If everything is Okay, CA will create a certificate that contains the public key of sender. If the certificate is for web browser, it may contain the names and of the users The CA generates a message (MD) digest from the certificate and signs the hash with its private key producing a signed certificate. The CA then returns the signed certificate to the sender. 2018/12/31 Y K Choi

16 How do you handle a signed certificate
Before the sender sends a secure message, the sender asks the recipients to present a signed certificate. (This has been certified by CA) The sender decrypts the signed hash with the CA’s known public key to verify that the public key, name, and other identifying information. The sender now uses the public key to send a message with confidence that it is the correct one. 2018/12/31 Y K Choi

17 Root CA and Certificate Chain
You might ask who certifies the CA. It is a self-certified authority like Post Office in Hong Kong. Can a CA sign another CA? Yes, in this case, the signed CA is called secondary CA which can now sign the one below it. This is called chain CA. (You are holding an ID card issued by HKSAR. If you use this card to apply for a bank account, the banker trusts HKSAR. In this case, you could regard HKSAR is the CA to certify yourself. Ask yourself, if you are holding a card by a restaurant, will the banker trusts you? No.) 2018/12/31 Y K Choi

18 Certificate Chain In this diagram, there is one root CA and two secondary CAs. One of them certifies an end user. Example is your card issued by CityU. CityU in this case is a secondary certifying authority which is set up under HKSAR. 2018/12/31 Y K Choi

19 Certificate Expiration and Revocation List
The public key might change due to loss, theft etc. This is related to certificate expiration. Revocation list means a database kept by CA of some sort that holds the identities of all certificates that have become invalid. Keeping a list might be impractical and so all certificates have an expiration date, typically one year. 2018/12/31 Y K Choi

20 The importance of Private Keys
The public key infrastructure depends on the security of private keys. If a private key is corrupted or stolen, you never read the encrypted message. If the public key is stolen and might be used to forge the digital signature of its owner. 2018/12/31 Y K Choi

21 How private key works The private key is usually kept in the harddisk in encrypted form and is loaded into memory when it is used. The problem is: if the machine is infected by virus, the key is unable to be recovered. Solution: Port the key into ROM and sealed into a smart card. The owner will carry the key. 2018/12/31 Y K Choi

22 Summary Message digest – no encryption but authentication (this is to ensure that the right person sends it) Digital envelope –combines symmetric and asymmetric key together, secure and efficient CA: Certified authority to keep the public keys so that you can trust 2018/12/31 Y K Choi

23 Review - PKI (Public Key Infrastructure)
PKI is a technology for exchange digital files on the internet. This technology is based on Public Key Encrypt (Asymmetric )technique which can encrypt data and confirm by signature etc. PKI system is constituted by digital certificate for verifying identity, Certificate Authority for issuing and guaranteeing certificate, and digital key technology (public key, private key) included in digital certificate. 2018/12/31 Y K Choi

24 Review - digital certificate
Digital certificate is an digital identification for guaranteeing an individual on the Internet. The data is formatted based on the following information issued by CA (Certificate Authority). The Information of CA which has issued the certificate The Signature of CA which has issued the certificate Public key registerd by CA Information of public key owner 2018/12/31 Y K Choi

25 Review - Certificate Authority
By signing a certificate, the third party organization guarantees that the certificate is authentic one. Since an digital certificate is digital data, anyone can make it, it isn't admitted without the CA signature, which can trust the digital certificate. 2018/12/31 Y K Choi

26 Next Week What is Link Security?
Link security objectives by link encryption In-line encryptor hardware Point to point deployment IP-routed development Key Recovery 2018/12/31 Y K Choi


Download ppt "Lecture 4 - Cryptography"

Similar presentations


Ads by Google