Information Security
Information Security
Information Security
Encryption and Decryption: AES can turn readable data (plain text) into a
secret code (cipher text) and then back to readable data using a key.
Key Size: AES uses keys that can be 128, 192, or 256 bits long. A longer key
means stronger security.
Blocks: AES processes data in blocks of 16 bytes (128 bits) at a time. If the
data is longer, it gets divided into multiple blocks.
Security: AES is widely used and trusted because it is very difficult for
someone to break the code without the right key.
Example:- Encryption.
The Data Encryption Standard (DES) is a symmetric-key block cipher that was
established as a federal standard for encrypting sensitive but unclassified
information.
Symmetric Encryption: The same key is used for both encryption and
decryption, meaning that both the sender and receiver must have access to
the secret key.
Key Size: The effective key length is 56 bits, although the key is originally
supplied as a 64-bit key (with every 8th bit used for parity).
Example of DES:
Key Length: The key used for encryption is the same length as the message
being encrypted.
Randomness: The key must be completely random and never reused (hence
"one-time").
Key Distribution: The key must be securely shared between the sender and
recipient before communication begins.
Encryption:
Example:
Decryption:
Example:
Advantages:
Theoretical Security: If used correctly (with a truly random key that is as long
as the message and never reused), OTP provides perfect secrecy.
Disadvantages:
Key Management: The major challenge is the secure generation and
distribution of the keys.
Key Length: Requires a key that is at least as long as the message, making it
impractical for large amounts of data.
1. Asymmetric Encryption: RSA uses two keys, one public (for encryption) and
one private (for decryption).
2. Foundation: It relies on the mathematical properties of large prime numbers
and the difficulty of factoring their product.
Steps in RSA:
Key Generation:
Encryption:
1. Convert the plaintext message MMM into an integer mmm such that
0≤m<n0 \leq m < n0≤m<n.
2. Compute the ciphertext c=memod nc = m^e \mod nc=memodn.
Decryption:
· Key Generation:
· Encryption:
· Decryption:
1. Generate a pair of keys: a public key (e,n)(e, n)(e,n) and a private key
(d,n)(d, n)(d,n).
Signing:
Verification:
Example:
Key Generation:
A hash function is a mathematical function that takes an input (data) and converts it
into a fixed-size string of characters, called a hash or digest. Hash functions are
widely used in cryptography, data integrity, and indexing.
Key Features:
1. Fixed Output Size: Regardless of input size, the output hash always has a
fixed length.
2. Deterministic: The same input always produces the same output.
3. Irreversible: It's nearly impossible to reverse the hash to get the original
input.
4. Collision-Resistant: It's hard to find two different inputs with the same hash.
Example:
Example Input:
Input: "cat"
ASCII values: 'c' = 99, 'a' = 97, 't' = 116
Sum = 99+97+116=31299 + 97 + 116 = 31299+97+116=312
Hash: 312mod 10=2312 \mod 10 = 2312mod10=2.
Input: "dog"
ASCII values: 'd' = 100, 'o' = 111, 'g' = 103
Sum = 100+111+103=314100 + 111 + 103 = 314100+111+103=314
Hash: 314mod 10=4314 \mod 10 = 4314mod10=4.
Q7.Explain SSL with an example.
Handshake:
1. When you visit a secure website (e.g., one using HTTPS), your browser
and the server initiate an SSL handshake.
2. The server sends its SSL certificate to prove its identity.
Encryption:
Secure Communication:
1. All data (e.g., login credentials, payment details) transmitted over this
link is encrypted and safe from eavesdropping.
Example:
Without SSL:
username=JohnDoe&password=1234 → (sent as plain text, visible to attackers).
With SSL:
Data is encrypted and might look like:
7fj39kfj#%Tyu9@lkdhs3$&*k.
Key Benefits:
Deterministic:
1. The hash value (digest) is always of a fixed size, regardless of the input
size (e.g., SHA-256 always gives a 256-bit hash).
Efficient to Compute:
Pre-image Resistance:
Collision Resistance:
1. It should be very hard to find two different inputs that produce the
same hash.
Avalanche Effect:
1. A small change in the input should drastically change the hash output.
Uniqueness:
1. The hash function can handle inputs of arbitrary size and reduce them
to a fixed-size output.
Example:
Changing the input to "Hello" (capital "H") gives a completely different hash.
Q9.write a program to create large prime number of size 2048bits
Output:
32317006071311007300714876688669951960444102669715484032130345427524
6551...
Q10.Explain public key infrastructure in short
Digital Certificates:
1. Acts like a "digital passport," binding a public key to the identity of its
owner.
2. Contains information such as the public key, owner's details, CA's
signature, and expiration date.