You are on page 1of 43

Cryptography and Network Security

Presented By :
CHANDINI.BANDI
20C51A6605
CSE(AI&ML)

Guided By :
Mr.K.RAGHUVARDHAN
(Assistant Professor)
Abstract

• The rapid proliferation of digital communication and the increasing interconnectedness of the modern
world have given rise to unprecedented security challenges.

• In this age of information, ensuring the confidentiality, integrity, and availability of data is paramount.

• Cryptography and network security have emerged as crucial pillars in the ongoing battle to protect
digital assets and sensitive information.
Contents
• Introduction
• Definitions of Cryptography and Network Security
• Security Attacks
• Security Services
• Security Mechanisms
• Encryption
• Decryption
• Categories of Encryption
The type of operation used in converting plain text to cipher text
1.Substitution Technique
2.Transposition Technique
Based on the number of keys used
1.Symmetric
2.Asymmetric
The way in which plain text is processed
1.Stream cipher
2.Block cipher
• Conclusion
Introduction

• Cryptography and network security are the twin guardians of our digital age.

• Cryptography, the art of secret writing, serves as the cornerstone of data protection, ensuring the confidentiality
and integrity of our most sensitive information.

• Network security, on the other hand, fortifies the highways of digital communication, shielding our data from
ever-present threats in the interconnected world.

• Together, they form an indispensable shield against cyberattacks and breaches, enabling us to navigate the digital
landscape with confidence and trust.
Definitions of Cryptography and Network Security

• Cryptography:

Cryptography is the science of secure communication, using mathematical techniques to


protect data confidentiality and integrity.

• Network Security:

Network Security involves measures to safeguard computer networks from unauthorized


access, ensuring data privacy, and protecting against cyber threats.
Security Attacks

• Passive Security Attacks :


They involve eavesdropping or monitoring network traffic to gather information without altering or disrupting it.

1. Packet Sniffing: Capturing data packets to obtain sensitive information.


2. Traffic Analysis: Analyzing patterns in network traffic to deduce information.

• Active Security Attacks :


They can lead to data alteration, unauthorized access, or network disruption.

1. Denial of Service (DoS) Attack: Overloading a system or network to make it unavailable.


2. Man-in-the-Middle (MitM) Attack: Intercepting and altering communication between two parties.
3. Malware: Software designed to harm or compromise systems, such as viruses and ransomware.
Security Services

• Confidentiality Services :
Ensuring data remains private and inaccessible to unauthorized users through encryption.
• Integrity Services :
Protecting data from unauthorized alteration or tampering, often using cryptographic hashes.
• Authentication Services :
Confirming the identity of users and entities involved in communication. Includes digital
signatures.
• Access Control Services :
Managing permissions and authorization to determine user or system access rights.
• Non-Repudiation Services :
Preventing parties from denying their involvement in a transaction or communication.
• Secure Key Management :
Distribution and management of cryptographic keys for encryption and decryption.
Security Mechanisms
• Encryption :
Encryption is the process of converting plaintext data into ciphertext using cryptographic algorithms.
• Decryption :
Decryption is the reverse process of converting ciphertext back to plaintext using the appropriate key.
• Digital Signatures :
Digital signatures provide a means of verifying the authenticity and integrity of digital documents or
messages.
• Hash Functions :
Hash functions generate fixed-size output (hash) from variable-size input data.
• Authentication Mechanisms :
Authentication ensures the identity of users and entities involved in communication.
• Access Control :
Access control restricts user or system permissions based on roles or policies.
Encryption

• Definition: Encryption is the process of converting data into a secure, unreadable format using algorithms
and keys.

• Purpose: To protect data from unauthorized access and maintain its confidentiality and integrity.

• Key Components: Plaintext, Ciphertext, Encryption Keys.


Decryption

• Definition : Decryption is the process of converting encrypted data (ciphertext) back into its original,
readable form (plaintext) using the appropriate decryption key.

• Purpose : To restore data to its original state, allowing authorized users to access and understand it.

• Key Components : Ciphertext, Decryption Key.


Block diagram of Encryption and Decryption
Categories of Encryption

• The type of operation used in converting plain text to cipher text


1.Substitution Technique
2.Transposition Technique

• Based on the number of keys used


1.Symmetric encryption
2.Asymmetric encryption

• The way in which plain text is processed


1.Stream cipher
2.Block cipher
Substitution technique

• Substitution technique is a method used to encode or encrypt information by replacing elements of the plaintext
(original message) with other elements, typically from a predefined set or through some algorithmic process.

• This technique is a fundamental concept in classical cryptography and is used in various encryption methods.

• Here are some common examples of substitution techniques:

1.Caesar Cipher

2.Monoalphabetic Cipher
1.Caesar Cipher

• The Caesar Cipher is a simple substitution cipher where each letter in the plaintext is shifted a fixed number of
positions down or up the alphabet. This fixed shift is known as the "key." For example, with a key of 3, 'A'
becomes 'D,' 'B' becomes 'E,' and so on. The process is cyclic, so after 'Z,' it wraps around to 'A.'
• Here's an example of the Caesar Cipher with a key of 3
• Encryption:
Plain Text: HELLO
Shift each letter by 3 positions to the right: H->K, E->H, L->O, L->O, O->R
Ciphertext: KHOOB
• Decryption:
Ciphertext: KHOOB
Shift each letter by 3 positions to the left: K->H, H->E, O->L, O->L, R->O
Plain Text: HELLO
• In this example, "HELLO" is encrypted to "KHOOB" using a Caesar Cipher with a key of 3. To decrypt
"KHOOB" back to "HELLO," you simply shift each letter in the ciphertext 3 positions to the left.
Block diagram of Caesar Cipher
2.Monoalphabetic Cipher

• A Monoalphabetic Cipher is a simple substitution cipher in which each letter in the plaintext is replaced with a
fixed corresponding letter in the ciphertext. Each letter in the plaintext has one unique substitution in the
ciphertext. Here's an example using a Monoalphabetic Cipher
• Let's say we want to create a Monoalphabetic Cipher with the following key:
Plain Text: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher Text: M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
With this key, 'A' in the plaintext will always be substituted with 'M' in the ciphertext, 'B' with 'N,' 'C' with 'O,'
and so on.
• Now, let's encrypt the phrase "HELLO" using this Monoalphabetic Cipher
• Encryption:
Plain Text: H E L L O
Cipher Text: M H O O L
• In this example, "HELLO" is encrypted to "MHOOL" using the given Monoalphabetic Cipher key. To decrypt it
back to "HELLO," you would simply use the same key but in reverse to substitute the letters.
Block diagram of Monoalphabetic Cipher
Transposition Technique

• Transposition technique involve rearranging the characters or elements of the plaintext (the original message) to
create the ciphertext (the encrypted message).
• Unlike substitution techniques, which replace characters with other characters, transposition techniques change
the order of characters or elements to obscure the original message.
• Here are a couple of examples of transposition techniques:

1.Rail Fence Cipher (Zigzag Cipher)

2.Columnar Transposition Cipher


1.Rail Fence Cipher (Zigzag Cipher)

• The Rail Fence Cipher is a simple transposition cipher that arranges the plaintext characters in a zigzag pattern
and then reads them off row by row.
• The number of "rails" (rows) is the key to the cipher.
• Here's an example
• Encryption:
Plain Text: HELLO WORLD
Number of Rails: 3
The arrangement looks like this:
H . . O . . R . .
. ELOW O LD
. . L . . W . . D
• Reading off the ciphertext row by row: HORELOLWLDD
• Decryption:
To decrypt, you would use the same number of rails and reverse the process to obtain the original plaintext.
Block diagram of Rail Fence Cipher (Zigzag Cipher)

Encryption Decryption
Input : "GeeksforGeeks " Input : GsGsekfrek eoe
Key = 3 Key = 3
Output : GsGsekfrek eoe Output : "GeeksforGeeks "
2.Columnar Transposition Cipher

• In a Columnar Transposition Cipher, the plaintext is written in a grid, and the columns are then rearranged
according to a predetermined key.
• To decrypt, you arrange the columns in the original order. Here's an example:
• Encryption:
Plain Text: CRYPTO
Key: 3 (columns)
• Arrange the plaintext in a 3-column grid:
CRY
PTO
• Reading the columns in the order specified by the key: CRYPTO
• Decryption:
To decrypt, you would arrange the columns in the original order (3 columns in this case) to obtain the original
plaintext.
Block diagram of Columnar Transposition Cipher
Symmetric Encryption
• Symmetric encryption, also known as symmetric-key encryption or secret-key encryption, is a type
of encryption where the same key is used for both the encryption and decryption of data.
• In other words, the sender and the receiver share a common secret key to protect the confidentiality and integrity
of the information being exchanged.
• Here's how symmetric encryption works:
1.Key Generation: A secret key is generated, typically a random sequence of bits. This key must be kept secret
and securely shared between the communicating parties.
2.Encryption: The plaintext, which is the original data that needs to be protected, is encrypted using the secret
key.
3.Transmission: The ciphertext is transmitted over a potentially insecure communication channel, such as the
internet or a network.
4.Decryption: The recipient, who possesses the same secret key, decrypts the received ciphertext to recover the
original plaintext.
• Symmetric encryption is known for its efficiency and speed, making it suitable for encrypting large amounts of
data. However, it has a significant limitation: secure key distribution. The challenge lies in securely sharing the
secret key between the sender and the receiver.
• Common symmetric encryption algorithms include the Data Encryption Standard (DES), Advanced Encryption
Standard (AES), and the Rivest Cipher (RC) algorithms.
Example of Symmetric Encryption

• Example of symmetric encryption using the Advanced Encryption Standard (AES) algorithm, which is one of the
most widely used symmetric encryption algorithms.
• Suppose Alice wants to send an encrypted message to Bob. They both agree on a secret key before starting their
communication. Here's how the encryption and decryption process works.
1.Key Generation:
Alice and Bob agree on a secret key, let's say the key is: 0x2b7e151628aed2a6abf7158809cf4f3c.
2.Encryption (by Alice):
Alice wants to send the message "HELLO" to Bob.
She uses the secret key to encrypt the message using AES encryption.
The AES algorithm takes the plaintext and the secret key to produce ciphertext.
Plain Text: HELLO
Ciphertext: 0x39 0x25 0x84 0x1D 0x02
3.Transmission:
Alice sends the ciphertext to Bob over an insecure communication channel.
Example of Symmetric Encryption

4.Decryption (by Bob):


Bob receives the ciphertext from Alice.
He uses the same secret key to decrypt the ciphertext and recover the original plaintext.
Ciphertext: 0x39 0x25 0x84 0x1D 0x02
Plain Text: HELLO

• In this example, Alice and Bob share a secret key, and Alice uses this key to encrypt the message "HELLO"
before transmitting it. Bob, who also has the same secret key, decrypts the received ciphertext to recover the
original plaintext message.

• This demonstrates the basic principle of symmetric encryption, where the same key is used for both encryption
and decryption. The security of this system relies on keeping the key secret and secure. If an unauthorized party
gains access to the key, they can decrypt the ciphertext and compromise the confidentiality of the message.
Block diagram of Symmetric Encryption
Asymmetric Encryption
• Asymmetric encryption, also known as public-key encryption, is a cryptographic technique
that uses a pair of distinct but mathematically related keys: a public key and a private key. These keys work together
to provide secure communication and data protection. Asymmetric encryption addresses the key distribution
challenge of symmetric encryption by allowing individuals to encrypt messages using the recipient's public key,
which can only be decrypted by the recipient using their private key.
• Here's how asymmetric encryption works:
1.Key Pair Generation:
Each individual (or entity) generates a key pair consisting of a public key and a private key. These keys are
mathematically related, but it is computationally infeasible to derive one key from the other.
The public key is shared openly with anyone who wishes to send an encrypted message to the key pair
owner.
The private key is kept secret and never shared.
2.Encryption (using the recipient's public key):
Suppose Alice wants to send an encrypted message to Bob.
She obtains Bob's public key and uses it to encrypt her message.
3.Transmission:
Alice sends the encrypted message to Bob over an insecure communication channel.
4.Decryption (by the recipient using the private key):
Example of Asymmetric Encryption

• Example of asymmetric encryption using the RSA (Rivest-Shamir-Adleman) algorithm, one of the most widely
used asymmetric encryption algorithms.
1.Key Pair Generation:
Bob, the recipient, generates an RSA key pair.
Bob's public key (e.g., e = 65537, n = 93793) is openly shared.
Bob's private key (d) is kept secret.
2.Encryption (by Alice):
Alice, the sender, wants to send an encrypted message to Bob.
Alice obtains Bob's public key (e and n) and uses it to encrypt her message. In RSA, this typically involves
modular exponentiation.
Plain Text: "HELLO"
Public Key (e, n): (65537, 93793)
Ciphertext = (Message^e) mod n
Ciphertext = (72^65537) mod 93793 ≈ 8003
Example of Asymmetric Encryption

3.Transmission:
Alice sends the ciphertext (8003) to Bob over an insecure communication channel.
4.Decryption (by Bob):
Bob, the recipient, uses his private key (d) to decrypt the ciphertext and recover the original plaintext.
Plain Text = (Ciphertext^d) mod n
Plain Text = (8003^d) mod 93793 ≈ 72
Bob successfully decrypts the ciphertext to reveal the original plaintext, "HELLO."

• In this example, Alice used Bob's public key to encrypt her message. Only Bob, with his corresponding private
key, can decrypt and read the message. This demonstrates the key principle of asymmetric encryption: the public
key is used for encryption, while the private key is used for decryption, ensuring that only the intended recipient
can read the message.
• RSA is just one example of an asymmetric encryption algorithm. It is widely used for secure communication,
digital signatures, and various other applications where secure data exchange and authentication are essential.
Block diagarm of Asymmetric Encryption
Stream Cipher

• A stream cipher is a type of symmetric-key encryption algorithm used for securing digital data. Unlike block
ciphers, which process data in fixed-size blocks, stream ciphers operate on individual bits or bytes of data one at
a time. They encrypt the plaintext by generating a pseudorandom stream of bits, which is then combined with the
plaintext using bitwise operations (such as XOR) to produce the ciphertext.
• Here's a simplified example of how a stream cipher works:
1.Key Generation: A secret key is generated or shared between the sender and receiver. This key is used to
initialize the PRNG.
2.Keystream Generation: The PRNG, initialized with the key, generates a pseudorandom stream of bits, known as
the keystream. The keystream should be as unpredictable as possible.
3.Encryption: The keystream is XORed with the plaintext bit by bit. Each bit of the plaintext is combined with the
corresponding bit of the keystream to produce the ciphertext.
4.Decryption: To decrypt the ciphertext, the same keystream is generated using the same key and XORed with the
ciphertext, which yields the original plaintext.
• Stream ciphers are commonly used in wireless communication systems, as well as in many modern encryption
protocols, including some cryptographic algorithms used in secure network protocols like TLS (Transport Layer
Security) and WEP (Wired Equivalent Privacy) for Wi-Fi. These ciphers provide confidentiality to data
transmitted over such networks.
Example of a Stream Cipher

• Suppose we have a simple stream cipher that generates a keystream using a secret key.
For this example, we'll use a simple key: 10101. The plaintext we want to encrypt is: 11010.
1.Key Generation:
Secret Key: 10101
2.Keystream Generation:
In a real stream cipher, a complex PRNG generates a keystream, but for simplicity, we'll use the key as the
keystream in this example.
Keystream: 10101
3.Encryption:
The plaintext is 11010, and the keystream is 10101.
We perform bitwise XOR between the plaintext and the keystream:
01111 (Ciphertext)
4.Decryption:
To decrypt the ciphertext, we use the same keystream (in this case, the secret key) and XOR it with the
ciphertext:
11010 (Plaintext)
As you can see, XORing the ciphertext with the same keystream (secret key) yields the original plaintext,
which is 11010.
Block diagram of stream cipher
Block Cipher

• A block cipher is a symmetric-key encryption algorithm that operates on fixed-size blocks of data, typically
chunks of data of a specific size, such as 64, 128, or 256 bits. Block ciphers are used to encrypt and decrypt data
in discrete blocks, as opposed to stream ciphers that operate on individual bits or bytes.
• Block Cipher Example:
Suppose we have a block cipher with a 4-bit block size and a secret key, and we want to encrypt the 4-bit
plaintext "1101."
1.Key Generation:
A secret key is generated or shared between the sender and receiver.
2.Plaintext: The plaintext is "1101," which fits into a single 4-bit block.
3.Encryption Process:
Let's say the key is 0101 (4 bits), and the permutation algorithm swaps the first and second bits, and the
third and fourth bits:
Plaintext: 1101 Key: 0101
Permutation:
Swap bits 1 and 2: 0110
Swap bits 3 and 4: 0011
Ciphertext: 01100011
Block Cipher

4.Decryption Process:
The decryption process involves applying the same secret key and the reverse permutation to recover the
plaintext.
Ciphertext: 01100011
Key: 0101
Reverse Permutation:
Reverse swapping bits 1 and 2: 0011
Reverse swapping bits 3 and 4: 1100
Decrypted Plaintext: 00111100

• So, in this simplified example, the plaintext "1101" was encrypted to "01100011" using the block cipher and a
secret key. The decryption process, using the same key and the reverse permutation, recovers the original
plaintext, "1101."
Block diagram of block cipher
AES algorithm

• AES, or Advanced Encryption Standard, is a widely used symmetric encryption algorithm. It was established as a
federal standard for encryption by the U.S. National Institute of Standards and Technology (NIST) in 2001. AES
is a symmetric key algorithm, meaning the same key is used for both encryption and decryption. It replaced the
older Data Encryption Standard (DES) due to its superior security and efficiency.
• Block Cipher: AES operates on fixed-size blocks of data, typically 128 bits (16 bytes). It supports key sizes of
128, 192, and 256 bits, which determine the encryption strength. The larger the key, the more secure the
encryption.
• Substitution-Permutation Network: AES employs a series of mathematical operations that include substitution
(replacing bytes with others), permutation (rearranging bytes), and XOR (exclusive OR) operations. These
operations are applied in a precise and predefined sequence, creating a confusion and diffusion effect, which
enhances the security of the algorithm.
• Number of Rounds: The number of rounds in AES depends on the key size. For a 128-bit key, there are 10
rounds; for a 192-bit key, there are 12 rounds; and for a 256-bit key, there are 14 rounds. Each round applies a set
of transformations to the data.
• Key Expansion: AES uses a key expansion algorithm to derive round keys from the original encryption key.
These round keys are used in the various rounds of encryption and are derived from the original key through a
process that incorporates substitution and permutation operations.
AES algorithm
• Security: AES is considered highly secure and has withstood extensive cryptanalysis. The security of AES is
based on the fact that it is computationally infeasible to break the encryption without knowing the correct key.

• Speed and Efficiency: AES is designed to be efficient in both hardware and software implementations, making it
suitable for a wide range of applications, from securing communications over the internet to encrypting data on
disk or in memory.

• AES encryption and decryption involve multiple rounds of the substitution-permutation network, and each round
applies a different set of operations. The final result after all rounds is the encrypted data, which can only be
decrypted with the correct key.

• AES has become the standard for symmetric encryption in many applications, and it is used in various security
protocols and systems, such as SSL/TLS for secure web browsing, IPsec for secure network communication, and
in encryption software for data protection. It is a crucial tool for securing sensitive information and ensuring the
confidentiality and integrity of data.
AES algorithm
Characteristics of AES

 AES has keys of three lengths which are of 128, 192, 256 bits.

 It is flexible and has implementation for software and hardware.

 It provides high security and can prevent many attacks.

 It doesn’t have any copyright so it can be easily used globally.

 It consists of 10 rounds of processing for 128 bit keys.


Advantages of AES

 It can be implemented on both hardware and software.

 It provides high security to the users.

 It provides one of the best open source solutions for encryption.

 It is a very robust algorithm.


Conclusion

• Safeguarding Our Digital World


Cryptography is the cornerstone of cybersecurity.
Key management, encryption algorithms, and security protocols are fundamental.
Protecting data in transit and at rest is paramount.
Vigilance against evolving threats is essential.
Compliance and continuous learning are critical.
Collaboration for a more secure online environment.
Thanks For Your
Patient Listening

You might also like