Chapter 4 Cryptography / Encryption
Introduction to Cryptography
Figure 30.1 Cryptography components The confidentiality principle mandates that information should solely be viewed by people with appropriate and correct privileges. It is achieved either by authorization / authentication i.e. providing right access and validating it at the time of accessing information or by cryptography, which involves encryption and decryption methods.
Figure 30.2 Categories of cryptography
Figure 30.3 Symmetric-key cryptography For symmetric encryption, the private key needs to be shared between both the communicating parties and there are multiple mechanisms like Diffie Hellman and RSA to achieve that. These mechanisms use asymmetric key i.e. Public Key Infrastructure to share the Secret Key.
Note In symmetric-key cryptography, the same key is used by the sender (for encryption) and the receiver (for decryption). The key is shared.
Assymetric Encryption: In this type of Encryption, a pair of keys known as Public Key and Private Key is used. As name indicates, Public Key is shared and known to everyone where as Private Key is with the person himself. Sender while Encrypting will use Receiver’s Public Key and encrypt the message whereas Receiver will use his/her Private Key to decrypt the message and read it.
Figure 30.4 Asymmetric-key cryptography
Figure 30.5 Keys used in cryptography
Example 30.1 The following shows a plaintext and its corresponding ciphertext. Is the cipher monoalphabetic? Solution The cipher is probably monoalphabetic because both occurrences of L’s are encrypted as O’s.
Digital Certificate An attachment to an electronic message used for security purposes. The most common use of a digital certificate is to verify that a user sending a message is who he or she claims to be, and to provide the receiver with the means to encode a reply. Now, you would think how to discover Public Key of others? The answer is Digital Certificate. A Digital Certificate contains information about its owner like name, Public Key, Validity of certificate etc. All the browsers recognize Digital Certificates and will download them automatically. They will extract the Public Key to decrypt the message before they show the content to the receiver. Hence, Digital Certificates is commonly used mechanism to share Public Key with each other.
PKI(Public Key Infrastructure ) There are 3 key roles in PKI as below: Certificate Authority (CA): A Certificate Authority issues digital certificates to person or organization which requests for it. In many cases, it will also play role of Verification Authority (VA) and verify the digital certificates. E.g. Here are some of Comodo, Symantec, GoDaddy, GlobalSign, DigiCert Registration Authority (RA): Registration Authority is responsible for accepting requests for digital certificates and authenticating the person or organization making the request. This authority will verify identity of person / organization and ensure that person / organization is what it is claiming. Validation Authority (VA): A Validation Authority (VA) is an organization which verifies the digital certificates. It is often a 3rd party organization i.e. a separate organization than CA or RA.
Certification Authority (CA) People, processes responsible for creation, delivery and management of digital certificates Organized in a hierarchy (use delegation) Root CA CA-1 CA-2
Registration Authority People, processes and/or tools that are responsible for Authenticating the identity of new entities (users or computing devices) Requiring certificates from CA’s.
Certificate Repository A database which is accessible to all users of a PKI, contains: Digital certificates, Certificate revocation information Policy information
Example Bob generates his own key pair Alice generates her own key pair public key Alice private key Bob generates his own key pair public key Bob private key Both send their public key to a CA and receive a digital certificate
Example Bob gets Alice’s public key from the CA Alice gets Bob’s public key from the CA private key Alice public key Bob Bob gets Alice’s public key from the CA private key Bob public key Alice
Key Establishment Method 2: Diffie-Hellman Key Exchange Agree on two numbers n, g; both numbers can be made public! Alice and Bob pick two secret numbers x and y n=10, g=7, x=3, g^x mod n = 3; y=5, g^{xy} mod n = 3; g^y mod n = 7; g^{xy} mod n = 3.