0% found this document useful (0 votes)
20 views

Network Security

The document discusses various cryptography concepts including encryption techniques like symmetric and asymmetric encryption, cryptographic algorithms like MD5 and SHA-256, and security services like authentication, authorization, and integrity. Public key cryptography plays an important role in key distribution and ensuring secure communication on the internet.

Uploaded by

NABEEL KHAN
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Network Security

The document discusses various cryptography concepts including encryption techniques like symmetric and asymmetric encryption, cryptographic algorithms like MD5 and SHA-256, and security services like authentication, authorization, and integrity. Public key cryptography plays an important role in key distribution and ensuring secure communication on the internet.

Uploaded by

NABEEL KHAN
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

​ A.

Security device deployed at the boundary of a corporate intranet to protect it


from unauthorized access.
​ A. Scrambling it to preserve its security.
​ A. Protect business information from eavesdropping when it is transmitted on
the internet.
​ A. Cryptography.
​ A. Plain text.
​ A. Ciphertext.
​ A. Encryption.
​ A. Cipher.
​ A. Symmetric key.
​ B. Private key.
​ A. Substitution.
​ A. Substitution.
​ B. Transposition.
​ B. P-box.
​ B. 16.
​ B. 48-bit.
​ B. Triple DES.
​ A. Diffie-Hellman.
​ A. Man-in-the-Middle (MitM) Attack.
​ A. Symmetric key.

What are the different uses of public key cryptography related to key distribution?
Public key cryptography plays a crucial role in various applications related to key
distribution, ensuring secure communication and cryptographic operations.
​ Key Exchange Security:
○ Enables secure key exchange (e.g., Diffie-Hellman) for confidential
communication.
​ Digital Signatures for Trust:
○ Provides authentication and non-repudiation through signed messages,
enhancing trust in documents and software updates.
​ SSL/TLS Secure Communication:
○ Utilized in SSL/TLS protocols for internet communication, ensuring secure
key exchange for confidentiality and integrity.
​ Email Encryption Confidentiality:
○ Used in email encryption for confidential communication by enabling secure
distribution of public keys.
​ VPN Security and Authentication:
○ Employs public key cryptography in VPNs for secure key distribution and
authentication, establishing encrypted tunnels.
​ Enhanced SSH Access:
○ Enhances remote access security by using public key cryptography for user
authentication.
​ Code Signing Integrity:
○ Ensures code integrity and authenticity in software development through
the use of digital signatures with private and public key pairs.

Categories of Passive Threats:


​ Monitoring:
● Definition: Unauthorized observation or surveillance of network activities.
● Example: Eavesdropping on communication to gather sensitive
information.
​ Traffic Analysis:
● Definition: Analyzing patterns and characteristics of data flows to deduce
information.
● Example: Monitoring communication frequency and volume to infer
relationships.
​ Release of Message Contents:
● Definition: Unauthorized disclosure of message contents to unauthorized
entities.
● Example: Data leakage through hacking or insider threats.

Categories of Active Threats:


​ Masquerade:
● Definition: Pretending to be someone else to gain unauthorized access.
● Example: Using stolen credentials to log in as an authorized user.
​ Replay:
● Definition: Repetitive transmission of valid data to gain unauthorized
privileges.
● Example: Replaying captured authentication credentials to gain access.
​ Modification of Message:
● Definition: Unauthorized alteration of the content of a message.
● Example: Tampering with data in transit to change its meaning.
​ Denial of Service (DoS):
● Definition: Disrupting or degrading the availability of a system or network.
● Example: Overloading a website with traffic to make it inaccessible to
legitimate users.

Categories of Security Services:


​ Confidentiality:
● Definition: Ensures that information is accessible only to authorized users.
● Services: Encryption, access controls, data classification.
​ Integrity:
● Definition: Ensures that information remains unaltered and trustworthy.
● Services: Hash functions, digital signatures, version control.
​ Authentication:
● Definition: Verifies the identity of users or systems.
● Services: Passwords, biometrics, multi-factor authentication.
​ Authorization:
● Definition: Controls access to resources based on user privileges.
● Services: Access control lists, role-based access control.
​ Non-repudiation:
● Definition: Ensures that a party cannot deny the authenticity of their
actions.
● Services: Digital signatures, audit trails, transaction logging.
​ Availability:
● Definition: Ensures that systems and resources are accessible when
needed.
● Services: Redundancy, backups, disaster recovery planning.


—-----------------------------------------------------------

Define stream cipher . Write a specific function of MAC in network security.

Stream Cipher:
A stream cipher is a type of symmetric-key encryption that processes plaintext one bit
or byte at a time, using a pseudorandom keystream. This keystream is combined with
the plaintext through bitwise XOR to produce the ciphertext, making stream ciphers
suitable for real-time communication.It has very high speed but it is also less secure as
compared to block cipher.

Extra:

Block Cipher:

A block cipher is a symmetric-key encryption method that processes fixed-size blocks


of plaintext simultaneously. Each block is encrypted independently and combined to
form the ciphertext. While block ciphers offer robust security, they may be less suitable
for real-time communication due to their block-wise processing nature.

MAC (Message Authentication Code) Functions Explained:

A Message Authentication Code (MAC) is a short piece of information generated using


a secret key to ensure the integrity and authenticity of a message. It helps verify that
the received message has not been tampered with and was sent by the expected
sender.
​ Integrity Verification:
● Ensures the message remains unaltered by checking for any changes or
modifications.
​ Authentication:
● Validates the origin of the message, confirming it comes from the
expected source.
​ Non-Repudiation:
● Links the sender to the message, preventing them from denying their
involvement.
​ Protection Against Tampering:
● Detects both intentional and accidental alterations in the message
content, ensuring data integrity.
​ Keyed Hash Function:
● Enhances security by utilizing a key to generate a secure hash, reinforcing
message integrity against unauthorized modifications.

Hash Function Properties : Any length input fixed length output (by using compression function) ,
Small Variation in input but large variation from output ( totally change whether the both input is
slightly change) , Collisions are possible ( Two input produces same output like SHA256 is not
collision but MD4 MD5 are) ,No Secrecy Involved (No key usage and secret used or involved except
producing the unique representation of a message)

What is the role of compression function in hash function ? What is the difference
between weak and strong collision resistance?

Role of Compression Function in Hash Function:

​ Compression Function:
● Hash functions use a compression function to reduce input data to a
fixed-size hash value.
● The compression function takes variable-sized input and produces a
fixed-size output (hash).
● Distributes input data uniformly across the hash space.
● Minimizes the chance of collisions (different inputs producing the same
hash).

Weak Collision Resistance:


● Definition:A hash function is weak collision-resistant if it is computationally
infeasible to find two different inputs that produce the same hash value.
● The goal is to prevent an attacker from finding two different inputs with the same
hash efficiently.
● Basic level.
● Suitable for general use.

Strong Collision Resistance:

● Definition: A hash function is strong collision-resistant if it is computationally


infeasible to find any two inputs that produce the same hash value.
● The goal is to prevent an attacker from finding any two inputs with the same hash
efficiently, even when intentionally chosen.
● Higher level, ideal for cryptography.
● Preferred for security-sensitive scenarios (e.g., digital signatures).

A hash function is a mathematical algorithm that transforms input data into a


fixed-size string of characters, known as a hash value. It is deterministic, fast, and
irreversible. Hash functions are used for various purposes, including ensuring data
integrity, storing passwords securely, creating digital signatures, and implementing
efficient data structures like hash tables. Key properties include fixed output length,
efficiency, irreversibility, and resistance to finding collisions (two different inputs
producing the same hash). Popular examples are SHA-256 and MD5 (though MD5 is
considered weak for security).

Describe MD5 message digest algorithm according to block


diagram.
MD5 Algorithm Block Diagram:

MD5 (Message Digest Algorithm 5) is a widely used cryptographic hash function that produces
a 128-bit (16-byte) hash value, typically expressed as a 32-digit hexadecimal number. It
operates in a series of rounds, with each round processing a fixed-size block of input data.

​ Initialization:
● Initialize A, B, C, D with constant values.
​ Padding:
● Append padding bits to the input message congruent to 448 modulo 512.
​ Message Processing :
● Divide padded messages into 512-bit blocks.
● Process each block in rounds (typically 64).
​ Round Operations :
● Use F function and constant values for each round.
​ Update State (A, B, C, D):
● Feedback loop updates state after each round.
​ Output (Hash Value):
● Concatenate final A, B, C, D values for the 128-bit hash.

From each of the following assets, assign a low , moderate or high impact level for the loss of
confidentiality availability and integrity respectively. justify your answers(five parts).

Define Euler function , Write its applications

APPLICATIONS:

1. RSA Cryptosystem: Generates public and private keys.


2. Cryptography: Enhances key security in various cryptographic systems.
3. Group Theory: Analyzes cyclic groups and primitive roots.
4. Number Theory: Provides insights into prime numbers and modular arithmetic.
5. Computer Science Algorithms: Used in algorithms like modular exponentiation.
6. E-commerce and Secure Communication: Ensures security in online
transactions.
Find x .
a) 5x=3 (mod 11)
b) same as above diff values.
c) same as above diff values.

Difference between unconditional security and computational security .


How Caesar cipher can cause brute force attack.


​ Unconditional Security: Unconditional security, also known as
information-theoretic security, implies that a cryptographic scheme remains
secure regardless of computational resources, algorithms, or advancements in
technology.
● Achieved through fundamental principles of mathematics and information
theory.
● Assumes unlimited computational resources for adversaries.
● Provides absolute security, independent of advances in computational
power or algorithms.
● Example: One-time pad encryption is unconditionally secure.

​ Computational Security: Computational security relies on the assumption that


certain computational problems are hard or infeasible to solve within a
reasonable amount of time, given current technology.
● Relies on the difficulty of specific mathematical problems.
● Security depends on the computational difficulty of specific algorithms.
● Example: RSA encryption relies on the difficulty of factoring large numbers.

Caesar Cipher and Brute Force Attack:

​ Caesar Cipher:
● Description: Caesar cipher is a substitution cipher where each letter in the
plaintext is shifted a certain number of places down or up the alphabet. It
is a simple and easily breakable encryption method.
● Vulnerability: There are only 25 possible keys (shift values) in the Caesar
cipher, making it susceptible to brute force attacks.
​ Brute Force Attack on Caesar Cipher:
● Method: A brute force attack involves trying all possible keys until the
correct one is found.
● Vulnerability in Caesar Cipher:
● Since there are only 25 possible keys, a brute force attack can be
easily executed by trying all 25 shifts.
● Automated scripts or algorithms can quickly decrypt Caesar
cipher-encrypted messages by testing each possible shift, revealing
the original message.

Two Problems with one-time pad cipher.???

Two Problems with One-Time Pad Cipher:

​ Key Management:
● Requires a truly random and lengthy key, posing challenges in secure key
generation, distribution, and storage.
● Practical difficulties in managing and securing long random keys
diminish its real-world applicability.
​ Key Reuse:
● Each key should only be used once to maintain perfect secrecy.
● Reusing the key compromises security, as patterns may emerge, making
it susceptible.
● Generating and distributing unique keys for each message is
resource-intensive and may not align with many communication systems'
constraints.
—------------------------------------------------------------
Define Reconnaissance Attempt and identify how we protect themselves from
this kind of attack?
—-
Reconnaissance Attempt:
A reconnaissance attempt is the initial phase of a cyber attack where an attacker
gathers information about a target. To protect against such attacks:

​ Network Segmentation: Divide and control network traffic.


​ Firewalls and IPS: Monitor and prevent malicious activity.
​ Regular Audits: Check logs and network traffic for anomalies.
​ Employee Training: Educate about social engineering risks.
​ Patch Management: Keep software up-to-date.
​ Multi-Factor Authentication: Add an extra layer of security.
​ Security Assessments: Regularly test and address vulnerabilities.

—-

What if the router becomes an attack target? Highlight some router


security considerations?

Router as Attack Target:


Router security is crucial as routers act as gateways between internal networks and the
broader internet. If a router becomes an attack target, several risks and consequences
arise:

1. Unauthorized access may occur.


2. Data interception and manipulation are possible.
3. Denial of service attacks may disrupt network services.
4. The compromised router can lead to a broader network breach.
5. Malicious firmware updates may be installed.
6. Traffic redirection and interception could compromise security.
7. Sensitive information might be stolen. Etc etc
The router security considerations include:

1. Access Control:
a. Implement strong authentication measures to control access.
2. Firmware Updates:
a. Regularly update router firmware to patch known vulnerabilities.
3. Default Credentials:
a. Change default usernames and passwords to prevent unauthorized
access.
4. Network Segmentation:
a. Use VLANs to segment and isolate different parts of the network.
5. Firewall Configuration:
a. Configure firewalls to filter incoming and outgoing traffic.
6. Encryption:
a. Use strong encryption protocols to protect communication channels.

—-
What are the candidate best practices to avoid header manipulation
and fragmentation attack?
—-
Header Manipulation and Fragmentation Attack Prevention:
To prevent header manipulation and fragmentation attacks:

1. Use TLS for encrypted communication.


2. Deploy Web Application Firewalls (WAF).
3. Validate and sanitize user inputs to prevent injection attacks.
4. Configure servers and applications securely.
5. Implement Content Security Policy (CSP) to define approved sources for content.
6. Set strict preventative header policies.
7. Implement rate limiting and payload size limitations.
8. Handle packet fragmentation carefully.
9. Conduct regular security audits.
—-
See each of the follwing assets , assign a low , moderate or high impact level for
the loss of cnfidentiality , availability and integrity , respectively , justify your
answers.(any two)
1) An organization managing public information on its web server.
2)A law-enforcement organization managing extremely sensitive investigative
information.
3)Financial organization managing routine administrative information (not privacy
-related information)
Ans:

Public Information Web Server:


Confidentiality: Low (Public data with minimal sensitivity, limited impact on public
information).
Availability: Moderate (Critical for public access).
Integrity: Low (Limited impact on public information).
Law Enforcement Investigative Information:
Confidentiality: High (Sensitive data requires protection).
Availability: Moderate (Operational importance).
Integrity: High (Critical for trust and accuracy).

Financial Administrative Information:


Confidentiality: Low (Routine data with lower sensitivity).
Availability: Moderate (Operational importance).
Integrity: Moderate (Significant for data accuracy).

Q : List out the two methods of operations in Authentication Header (AH) and
Encapsulating Security Payload (ESP).

Authentication Header (AH):

​ Authentication:
● Ensures data origin authentication and integrity.
​ No Encryption:
● Does not encrypt the payload.

Encapsulating Security Payload (ESP):

​ Encryption:
● Provides confidentiality through encryption.
​ Authentication (Optional):
● Can offer authentication in addition to encryption, but it's optional.

Q : Explain very briefly how transport and tunnel mode operates on AH packets for IPV4
. Suport your answer using AH packets figures for tunnel and transport mode of
operation

Transport Mode (AH):

● Operates on individual IP packets.


● AH header is inserted between the original IP header and the payload.
● Provides authentication and integrity for the payload.
● The original IP header is not modified.

Tunnel Mode (AH):


● Used for securing entire IP packets, often in a VPN scenario.
● Original IP header and payload are encapsulated in a new IP packet.
● AH header is inserted between the new IP header and the encapsulated packet.
● Provides authentication and integrity for the entire encapsulated packet.

Consider and ATM in which user provide a personal identification number (PIN) and a
card for account access. Give examples of confidentiality , integrity , and availability
requirements associatied with the system , In each case indicate the deggree of
importance of the requirement.
Confidentiality:

● PIN Protection:
● Importance: Critical
● Example: Keep user PIN confidential to prevent unauthorized access.
● Cardholder Information:
● Importance: High
● Example: Safeguard card details to prevent identity theft.

Integrity:

● Transaction Integrity:
● Importance: Critical
● Example: Ensure transaction accuracy to prevent tampering.
● Data Integrity in Transaction:
● Importance: High
● Example: Maintain data integrity during transmission.

Availability:
● System Uptime:
● Importance: Critical
● Example: Ensure continuous ATM availability.
● Response Time:
● Importance: High
● Example: Maintain quick transaction response times.

● RSA: Rivest-Shamir-Adleman
● MD5: Message Digest Algorithm 5
● PKI: Public Key Infrastructure
● CSPRNG: Cryptographically Secure Pseudo-Random Number Generator
● SSL: Secure Sockets Layer
● IP: Internet Protocol
● DES: Data Encryption Standard
● MAC: Message Authentication Code
● ESP: Encapsulating Security Payload
● SNMP: Simple Network Management Protocol
● CHAP: Challenge-Handshake Authentication Protocol
● AAA: Authentication, Authorization, and Accounting
● L2TP: Layer 2 Tunneling Protocol
● IKE: Internet Key Exchange

RSA Public Key Encryption Algorithm

​ Introduction to RSA:
● Named after its creators: Rivest, Shamir, and Adelman.
● Public-key cryptosystem involving two keys: public key (e) and private key
(d).
​ Issues with Secret Key Cryptography:
● Involves a single shared key for both sender and receiver.
● Drawbacks include key disclosure risks, the need for secure key exchange,
and the inability to protect against sender forgery.
​ Public-Key Cryptography:
● Uses two keys: public-key (encrypts messages, verifies signatures) and
private-key (decrypts messages, creates signatures).
​ Foundations in Mathematics:
● Built on insights about large numbers and trapdoor problems.
● Trapdoors are one-way functions, easy to compute in one direction but
hard in the reverse.
​ One-Way Functions (Trapdoors):
● Mathematical functions where computing forward is easy, but computing
backward is difficult.
● Fundamental to the security of public-key cryptography.
​ Multiplication as a Trapdoor Function:
● Multiplication can serve as a one-way function in modular arithmetic.
​ RSA Math:
● RSA is based on modular arithmetic.
● Primes, modular inverses, and Euler's phi-function play crucial roles.
​ Prime Numbers:
● Numbers divisible only by 1 and themselves.
● Used in RSA for their properties in modular arithmetic.
​ Modular Math and Inverses:
● Modular arithmetic involves operations within a defined range (modulus).
● Modular inverse: Two numbers whose product equals 1 modulo the
modulus.
​ Euler’s Phi-Function:
● Denoted as ϕ(n), counts the numbers less than n that are relatively prime
to n.
● For primes p, ϕ(p) = p - 1.
​ Exponential Period Modulo n:
● Numbers relatively prime to n have an exponential period modulo n.
● Useful in building the RSA public-key cryptosystem.
​ RSA Key Generation:
● Choose two large primes (p and q), compute modulus (n = pq), and select
a public exponent (e).
● Compute the private exponent (d) as the modular inverse of e modulo
ϕ(n).
​ RSA Encryption and Decryption:
● Encryption:
● �≡��mod �
● C≡M
● e
● modn
● Decryption:
● �≡��mod �
● M≡C
● d
● modn
​ RSA Example:
● Illustration with chosen primes, computation of public and private keys,
and encryption/decryption.
​ RSA in Official Standards:
● RSA is part of ISO, ITU-T, SWIFT, ANSI, and X.509 standards.
● Used in Internet protocols like S/MIME, IPSec, TLS, and others.
​ Current Usage of RSA:
● Integrated into major operating systems, commercial software, and
hardware devices.
● Widely adopted for secure Internet communication, with an estimated 300
million installed encryption engines.
​ Conclusion:
● RSA remains a fundamental and widely utilized public-key cryptosystem,
offering secure encryption and digital signatures in various applications.
—----------------------------------------------------------------------------------------------------
DES (Data Encryption Standard) is a symmetric-key algorithm developed by IBM in

response to a public request for proposals by the National Bureau of Standards (NBS),

now known as NIST (National Institute of Standards and Technology). Here is an

overview of DES:

1. History and Development:


● Developed in the 1970s by the National Bureau of Standards in collaboration with
the National Security Agency.
● Initial algorithm draft named LUCIFER with a 128-bit key.
● Became a federal standard in November 1976.

2. As a Federal Standard:
● Adopted as a U.S. federal standard in November 1976.
● Published by NBS as a hardware-only scheme in January 1977 and by ANSI for
both hardware and software standards in ANSI X3.92-1981.
● Widely adopted globally.

3. Basics of DES:
● Utilizes the cryptographic techniques of confusion and diffusion.
● Confusion achieved through permutations and diffusion through the XOR
operation.
● Uses an S-P network.

4. S-P Network:
● Central to DES, involving substitution and permutation operations.

5. DES Operation in a Nutshell:


● Involves an initial permutation (IP), 16 rounds of complex key-dependent
calculations, and a final permutation (inverse of IP).

6. The 16 Rounds:
● Enciphering a 64-bit data block and a 56-bit key involves initial permutation, 16
rounds, and a final permutation.

7. Swapping of Left and Right Halves:


● The 64-bit block is divided into two halves, swapping between rounds.

8. Key Processing:
● Key stored as a 64-bit number with parity bits.
● Parity bits discarded, resulting in a 56-bit key.
● 16 different 48-bit subkeys generated from the key.

9. Key Schedule:
● Involves an initial permutation of the key (PC-1), 16 stages of subkey generation,
and a final permutation (PC-2).

10. DES Operation Steps:


● Block halving, expansion permutation, XOR with subkey, S-box substitution, P-box
permutation, and swapping halves.

11. Permutations in DES:


● Initial and final permutations aid in hardware implementation.
● Avalanche effect achieved through expansion permutation.

12. Weak Keys:


● Some keys are considered weak, but they are easily detectable during key
generation.

DES, while historically significant, is no longer considered secure due to its small key

size. Modern cryptographic standards, such as AES (Advanced Encryption Standard),

have replaced DES for securing sensitive data.

—----------------------------------------------------------
Encryption and Cryptography:
● Encryption transforms plaintext into ciphertext using an encryption algorithm and
a key.
● Decryption reverses the process using the same algorithm and key.

Definitions:

● Encryption (C = EK(P))
● Decryption (P = EK^(-1)(C))
● EK chosen from a cryptographic system.

Algorithm Secrecy:

● Relying on the secrecy of algorithms is not sufficient for real-world security.

Encryption Algorithm Types:

● Symmetric (secret-key) and Asymmetric (public-key) algorithms.

Symmetric Algorithms:

● Stream ciphers (operate on one bit at a time).


● Block ciphers (operate on a block of bits).

Asymmetric Algorithms:

● Public-key is for encryption, private-key is for decryption.

Speed Comparison:

● Symmetric algorithms are generally faster than asymmetric ones.

Cryptography Through History:

● Ancient Egyptians, Hebrews, Caesar, Chaucer, Alberti, Vigenère, and more.


● Use in diplomacy and war over centuries.

Historical Ciphers:

● Scytale cipher, Jefferson cylinder, Wheatstone disc, Enigma, Caesar cipher.

Classical Cryptographic Techniques:

● Substitution and transposition.

Monoalphabetic and Polyalphabetic Ciphers:

● Monoalphabetic (one substitution), Polyalphabetic (multiple


substitutions/transpositions).
Caesar Cipher:

● Shifts letters by a fixed distance.

Transposition Ciphers:

● Rearrange letters' order (e.g., Scytale).

One Time Pad:

● Unbreakable symmetric cipher using random key pads.

Trapdoor Problem:

● Mathematical challenge; easy forward, hard backward.

Uses of Encryption:

● Confidentiality, User Authentication, Message Authentication, Proof of Origin.

Location of Encryption in OSI Model:

● Controversial, but typically in physical, transport, or presentation layers.

Cryptanalysis and Attacks:

● Ciphertext-only, Known-plaintext, Chosen-plaintext attacks.

Security Models:

● Unconditional security (cipher cannot be broken), Computational security (hard to


break with limited resources).
● Caesar Cipher:
○ Type: Monoalphabetic substitution cipher.
○ Operation: Each letter in the plaintext is shifted by a fixed distance.
● Scytale Cipher:
○ Type: Transposition cipher.
○ Operation: A strip of paper is wound around a staff, and the message is
written in rows. When unwound, it appears as seemingly random letters.
● Jefferson Cylinder:
○ Type: Transposition cipher.
○ Operation: Comprised 36 disks, each with a random alphabet. The order of
disks was the key, and another row became the cipher.
● Wheatstone Disc:
○ Type: Polyalphabetic cipher.
○ Operation: Comprised two concentric wheels used to generate a
polyalphabetic cipher.
● Enigma Rotor Machine:
○ Type: Substitution cipher machine.
○ Operation: Comprised a series of rotor wheels with internal
cross-connections, providing a substitution using a continuously changing
alphabet. Heavily used during World War II.
● Morse Code:
○ Type: Substitution cipher.
○ Operation: Encoding text characters as sequences of dots and dashes.
● One-Time Pad:
○ Type: Symmetric cipher.
○ Operation: Involves using sheets of paper with random numbers to
transform the message. Each number or sequence is used only once.
● Trapdoor Problem:
○ Concept: A mathematical challenge where it is easy to perform a
computation in one direction but difficult in the reverse direction. Used in
public key cryptography.
● Public Key Cryptography (Asymmetric):
○ Type: Asymmetric encryption.
○ Operation: Uses a pair of keys (public and private) for encryption and
decryption. Examples include RSA.
● Stream Ciphers (Symmetric):
● Type: Symmetric encryption.
● Operation: Encrypts one bit at a time.
​ Block Ciphers (Symmetric):
● Type: Symmetric encryption.
● Operation: Encrypts a fixed-size block of bits as a single unit.

1. One-Time Pad:
Concept:
The One-Time Pad is a symmetric encryption technique that is theoretically unbreakable
if used correctly. It uses a key as long as the message and ensures perfect secrecy.

Operation:

​ The key is a random sequence of bits as long as the message.


​ To encrypt a message (plaintext), each bit of the plaintext is XORed with the
corresponding bit in the key.
​ To decrypt, the ciphertext is XORed again with the same key.

Example:

Let's take a simple example with a 4-bit message "1101" and a randomly generated key
"1010". The encryption would be as follows:

● Plaintext: 1101
● Key: 1010
● Ciphertext: 0111
To decrypt, the same key is used:

● Ciphertext: 0111
● Key: 1010
● Decrypted Plaintext: 1101

2. Block Cipher:
Concept:
A Block Cipher is a symmetric key algorithm that operates on fixed-size blocks of data.
It divides the plaintext into fixed-size blocks and applies the encryption algorithm
separately to each block.

Operation:

​ The plaintext is divided into fixed-size blocks.


​ Each block is encrypted independently using the same key.
​ Common block sizes include 64, 128, or 256 bits.

Example:

Let's use a basic example of a 4-bit block cipher with a key:

● Plaintext: 1101 0100 (two 4-bit blocks)


● Key: 1011

Now, each block is encrypted separately using the key:

● Encrypted Block 1: 0110


● Encrypted Block 2: 1111

So, the overall ciphertext would be 0110 1111.

It's important to note that modern block ciphers, such as AES (Advanced Encryption
Standard), use larger block sizes (128 bits for AES) and more complex operations for
enhanced security. The principles, however, remain similar.

You might also like