CRYPTOGRAPHY
CRYPTOGRAPHY
CONTENTS
• Definition
• Cryptography Issues
• Cryptography Components
• Cryptography Technique
• Cryptography Categories
• Symmetric key cryptography
• Asymmetric key cryptography
• Comparison of Symmetric and Asymmetric key cryptography
DEFINITION
CRYPTOGRAPHY
• A word with Greek origins, means “secret writing”.
• The term to refer to the science and art of transforming messages to make them secure and immune to attacks.
• Applications of cryptography includes ATM cards, computer passwords, and electronic commerce.
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
CRYPTOGRAPHY ISSUES
CRYPTOGRAPHY ISSUES
• Confidentiality: Only sender, intended receiver should “understand” message contents.
• End-Point Authentication: Sender and receiver want to confirm identity of each other.
• Message Integrity: Sender and receiver want to ensure message not altered (in transit, or afterwards) without detection.
CRYPTOGRAPHY COMPONENTS
PLAINTEXT AND CIPHERTEXT
• The original message, before being transformed, is called plaintext.
• After the message is transformed, it is called ciphertext.
• An encryption algorithm transforms the plaintext into ciphertext; a decryption algorithm transforms the ciphertext back into plaintext.
• Example:
• Plaintext: HELLO
• Ciphertext: KHOOR
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
CIPHER
• Encryption and Decryption algorithms are referred as ciphers.
• Also used to refer to different categories of algorithms in cryptography.
• Example (Traditional Substitution Ciphers):
• Monoalphabetic cipher
• Polyalphabetic cipher
• Plaintext: HELLO
• Ciphertext: ABNZF
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
KEY
• A key is a number (or a set of numbers) that the cipher operates on, as an algorithm.
• To encrypt a message, we need an encryption algorithm, an encryption key, and the plaintext.
• To decrypt a message, we need a decryption algorithm, a decryption key, and the ciphertext. These reveal the original plaintext.
• Types:
• Shared key, Public key and Private key.
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
USE OF KEY
• Example:
• Use Monoalphabetic Cipher to encrypt “HELLO” with key = 3.
• Plaintext: HELLO
• Ciphertext: KHOOR
ALICE, BOB, AND EVE
• Alice is the person who needs to send secure data.
• Bob is the recipient of the data.
• Eve is the person who somehow disturbs the communication between Alice and Bob.
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
CRYPTOGRAPHY TECHNIQUE
CRYPTOGRAPHY TECHNIQUE
Alice Bob
Eve
Plaintext PlaintextCiphertext
Alice’sEncryptionKey K1
Bob’sDecryptionKey K2
If m = Plaintext, then• Ciphertext = K1(m) and • m = K2(K1(m))
CRYPTOGRAPHY CATEGORIES
CRYPTOGRAPHY CATEGORIES
• We can divide all the cryptography algorithms (ciphers) into two groups:
• Symmetric key (also called secret-key) cryptography algorithms and
• Asymmetric key (also called public-key) cryptography algorithms.
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
SYMMETRIC KEY CRYPTOGRAPHY
• In symmetric-key cryptography, the same key is used by both parties.
• The sender uses this key and an encryption algorithm to encrypt data; the receiver uses the same key and the corresponding decryption algorithm to decrypt the data.
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
SYMMETRIC KEY CRYPTOGRAPHY TECHNIQUE
Alice Bob
Alice’sEncryptionKey K
Bob’sDecryptionKey K
Plaintext PlaintextCiphertext
If m = Plaintext and K is the shared secret key, then• Ciphertext = K(m) and • m = K(K(m))
SharedSecretKey K
SYMMETRIC KEY CIPHERS
TraditionalCiphers
ModernCiphers
SubstitutionCiphers
Transposition
Ciphers
Mono-alphabetic
Ciphers
Poly-alphabetic
Ciphers
DES, AES, IDEA, CAST, RC4, RC5,
etc.
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
ASYMMETRIC KEY CRYPTOGRAPHY
• In asymmetric or public-key cryptography, there are two keys: a private key and a public key.
• The private key is kept by the receiver.
• The public key is announced to the public.
• If Alice wants to send a message to Bob, Alice uses the public key to encrypt the message. When the message is received by Bob, the private key is used to decrypt the message.
• Some of the asymmetric algorithms are:
• Diffie-Hellman, RSA, El Gamal, Elliptic Curve Cryptography (ECC), Man-in-the-Middle Attack etc.
Ref: Ch.30, Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan
ASYMMETRIC KEY CRYPTOGRAPHY TECHNIQUE
Alice BobCiphertextPlaintext Plaintext
Bob’sPublicKey K+
Bob’sPrivateKey K-
If m = Plaintext, then• Ciphertext = K+(m) and • m = K-(K+(m))
To PublicUsed for encryption
Used for decryption
COMPARISON OF SYMMETRIC AND ASYMMETRIC KEY CRYPTOGRAPHY
SYMMETRIC KEY CRYPTOGRAPHY
• Only 1 shared key is involved.
• The same key encrypts and decrypts the plaintext.
• The shared key is kept secret between Alice and Bob.
• Examples of Symmetric algorithms:
• DES, 3DES, AES, IDEA, BLOWFISH, TWOFISH, RC4, RC5, SAFER etc.
ASYMMETRIC KEY CRYPTOGRAPHY
• Here 2 keys : a private and a public key are involved.
• The Public key encrypts the plaintext while the private key decrypts it.
• The private key is just kept secret by the Bob while the public key is made public.
• Examples of Asymmetric algorithms:
• Diffie-Hellman, RSA, El Gamal, Elliptic Curve Cryptography (ECC) etc.
CONCLUSION
• By using of encryption techniques a fair unit of confidentiality, authentication, integrity, access control and availability of data is maintained.
• Using cryptography Electronic Mail Security, Mail Security, IP Security, Web security can be achieved.
REFERENCECHAPTER 30, CRYPTOGRAPHY
DATA COMMUNICATIONS AND NETWORKING
BY BEHROUZ A. FOROUZAN
THANK YOU
EXAMPLES
MONOALPHABETIC CIPHER
• Use Monoalphabetic Cipher to encrypt “HELLO” with key = 3.
Key=3 means shift each character of plaintext by character at 3 places ahead of it. Hence replacing H by K, E by H, L by O and O by R in the plaintext.
• Plaintext: HELLO
• Ciphertext: KHOOR
POLYALPHABETIC CIPHER
• Use Polyalphabetic Cipher to encrypt “HELLO” with key = 3,2.
Divide HELLO in group of 3 characters viz. HEL-LO and use key=3 to encrypt HEL and key=2 to encrypt LO.
• Plaintext: HELLO
• Ciphertext: KHONB
TRANSPOSITION CIPHER
• Encrypt the message "HELLO MY DEAR" using the key:
• Plaintext: 1234
• Ciphertext: 2413
In encryption, we move the character at position 2 to position 1, the character at position 4 to position 2, and so on. We first remove the spaces in the message. We then divide the text into blocks of four characters. We add a bogus character Z at the end of the third block. The result is HELL OMYD EARZ. We create a three-block ciphertext ELHLMDOYAZER.
• Plaintext: HELLO MY DEAR
• Ciphertext: ELHLMDOYAZER