Network Security
Network Security
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.
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:
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?
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).
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).
APPLICATIONS:
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.
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.
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:
—-
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:
Q : List out the two methods of operations in Authentication Header (AH) and
Encapsulating Security Payload (ESP).
Authentication:
● Ensures data origin authentication and integrity.
No Encryption:
● Does not encrypt the payload.
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
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
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),
overview of DES:
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.
6. The 16 Rounds:
● Enciphering a 64-bit data block and a 56-bit key involves initial permutation, 16
rounds, and a final permutation.
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).
DES, while historically significant, is no longer considered secure due to its small key
—----------------------------------------------------------
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:
Symmetric Algorithms:
Asymmetric Algorithms:
Speed Comparison:
Historical Ciphers:
Transposition Ciphers:
Trapdoor Problem:
Uses of Encryption:
Security Models:
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:
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:
Example:
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.