1.explain Cryptography and Its Types:: E, D, M, K, C
1.explain Cryptography and Its Types:: E, D, M, K, C
• E is an encryption algorithm
• D is an decryption algorithm
1. confidentiality
2. integrity
3. availability
Types of Cryptography
It is a Fast process
Examples:
Two keys: Public key (for encryption) and Private key (for decryption).
It is More secure for communication but slower than symmetric.
Examples:
RSA (Rivest–Shamir–Adleman
3. Hash Functions
Examples:
MD5
SHA-1, SHA-256.
This includes:
This includes:
Devices with weak and outdated algo have a risk if getting attacked
Algorithms like MD5 and SHA-1 are now considered insecure due to collision attacks.
Passwords are everywhere for quick recall one tends to use easy passwords such as name,
birthdates, school names etc. people who knows you can try to use it and access or steal
your data .
As a countermethod one should always choose or make a complex passwords that consists
of numbers words and special characters .
3.unpatched software:
Vendors release security patches that fixes something in the software installed previously .If
you don’t install these patches your system could be prone to attack because the required
security to fix that bug is not installed.
Detection Easier to detect due to system changes Difficult to detect; no system changes visible
Harm to system
resources Yes No
Steganography:
Steganography in Cryptography
Definition:
Audio files
Video files
Text documents
The secret message is embedded into the cover media using a steganographic
algorithm.
The receiver extracts the hidden data using the same or compatible algorithm.
📡 Types of Steganography
Audio Steganography WAV, MP3 files Hide info in audio samples or echo signals
Video Steganography Video files Hide data in video frames or motion vectors
✅ Advantages
❌ Disadvantages
Classical encryption refers to early methods of encrypting messages, developed before the
digital age. These techniques use simple mathematical transformations and manual
methods. They form the foundation of modern cryptography.
1. Substitution Techniques
a. Caesar Cipher
b. Monoalphabetic Cipher
c. Playfair Cipher
d. Hill Cipher
e. Vigenère Cipher
Example (3 rails):
Write text in rows under a keyword and rearrange columns based on alphabetical order of
keyword letters.
Example:
Keyword: ZEBRAS
Plaintext: WEAREDISCOVERED
2. Key Size – Length of the encryption key (e.g., 128, 192, 256 bits)
3. Rounds – Number of transformation steps (e.g., AES has 10, 12, or 14)
3DES 64 bits 112 or 168 bits More secure than DES, slower
It is Not parallelizable
Encrypts the previous ciphertext, XORs with plaintext to produce next ciphertext.
❌ Disadvantages
The Advanced Encryption Standard (AES) is the most widely used symmetric encryption
algorithm in the world. It is fast, secure, and used in applications ranging from Wi-Fi security
(WPA2/WPA3) to HTTPS, VPNs . It uses the same key for encryption and decryption. It act as
a block cipher.
🔑 Key Features:
The original key is expanded into multiple round keys (one for each round + one for
initial round).
1. SubBytes
Replace every byte in the matrix with another one using (S-box).
2. ShiftRows
o Row 0 = no shift
o Row 1 = shift by 1
o Row 2 = shift by 2
o Row 3 = shift by 3
3. MixColumns
4. AddRoundKey
SubBytes
ShiftRows
AddRoundKey
Decryption
o InvSubBytes
o InvShiftRows
o InvMixColumns
o AddRoundKey.
Flowchart:
Advantages :
Fast
Secure
Widely used
Feature Value
Rounds 16
1. Creation of 64 bit blocks: if the mssg if too long it is converted into the size of
64 bits blocks.
2. Initial permutation.: the mssg is arranged in a particular order. No security key
is added
3. Half slpits: left and right are splitted unto halfs (L0) and (R0) each are of 32
bits.
4. Subkey key generation: in this a subkey is generated from the 56bit key. And
this key is derived from complex mathematical concepts>
5. Rounds : it consists of 16 rounds . both left half and right half go through 16
rounds individually of encryptionoperation.
6. Final cipher text : after 16 rounds of encryption process data is encrypted.
Weaknesses of DES
Feature Value
✅ Advantages
❌ Disadvantages
Limitation Description
Substitution-Permutation Network
Structure Feistel Network
(SPN)
Q. El-Gamal Algorithm
El-Gamal Algorithm:
Key generation
Encryption
Decryption
Private Key: x
2. Encryption :Let’s say sender wants to send message M to the receiver.
3. Compute:
o C1 = g^k mod p
o C2 = M × y^k mod p
Receiver uses private key x , using the private key reciver decrypts the mssg.
It allows two people to generate a shared secret key over an insecure channel (like
the internet).
🎯 Goal:
To create a common secret key between two people (say, Alice and Bob) without sending it
directly.
MODULE 3: Cryptographic Hashes, Message Digests and Digital Certificates
It's like a fingerprint of the data. The length of the input could be just one character or a
video file the output for both the input will be of fixed size.
Security of hash functions :
3. collision resistance
Example:
Hash value:
6530004906493611d0735020db1/94360cac64f0
Output Size 128 bits (16 bytes) 160 bits (20 bytes) 256 bits (32 bytes)
Weak (collision
Security Weak (broken) Strong
found)
Collision
Poor Poor Good
Resistance
Pre-image
Weak Moderate Strong
Resistance
Digital Certificate X.509: A Digital Certificate is an electronic document used to prove the
ownership of a public key. It is issued by a Certificate Authority (CA) and follows a standard
format called X.509.
✅ Purpose:
o Is it still valid?
Example Use:
When you visit a secure website (https://), your browser checks the site's X.509 certificate to
ensure it’s trusted and secure.
Component Role
Certificate Authority (CA) Trusted third party that issues digital certificates
2. Certificate Request
The public key and identity are sent to a Certificate Authority (via RA).
3. Certificate Issuance
The CA verifies identity and issues a digital certificate (X.509 format), binding your
identity with your public key.
4. Secure Communication
Others can use your public key (from the certificate) to:
o Encrypt data (only you can decrypt it with your private key)
2. Signing Process:
o The hash is then encrypted with the sender's private key, creating the digital
signature.
o The original document and its digital signature are sent to the recipient.
3. Verification Process:
The recipient uses the sender’s public key to decrypt the signature, revealing the
hash value.
Feature Purpose
Developed by NIST.
The goal of this protocol is to generate and share a key that can be used for a secure
communication between two users .
Needham–Schroeder Asymmetric Key Protocol: in symmetric key based protocols there are
3 entities : 2 users and 1 server.
The goal of this protocol is to share the respective public keys between the two users.
Operating System Security refers to the measures and techniques used to protect the OS
from threats like unauthorized access, malware, data breaches, and system misuse. It
ensures confidentiality, integrity, and availability of data and services on a computer.
This includes:
Data confidentiality: Protecting sensitive data from being accessed by
unauthorized people.
2. Integrity – Keeping Information Accurate and Unchanged
Information should not be changed or tampered with by unauthorized people. If someone
alters the data without permission, its integrity is compromised.
This includes:
1.User Authentication:
2. Memory Protection : every file runs individually in its own space. So that no file can access
each others memory.
The Base is where the memory starts, and Limit is how big the box is.
The program can only use what's inside its box. If it tries to go outside, the system
says "No!" and blocks it.
2. Segmentation
This makes sure one section (like data) doesn't mess with another (like code).
3. Paging
4. Virtual Memory
If your program needs more memory than RAM has, the OS uses the hard disk as
fake RAM.
This lets your program run smoothly even when memory is tight.
File protection is a fundamental process in the OS. It is one of the most prominent features
of the Operating System . it ensures that unauthorised users cannot access the files /
folders , modify or alter the data present in the file , or location of the file.
This includes:
This includes:
1. Access Control
Each file or folder has a set of permissions based on who is trying to access it:
2. User Authentication
Ensures that only authorized users can log in and access files.
3. Encryption
Files are converted into unreadable form unless the correct key or password is used.
Even if someone steals the file, they can’t read it without the key.
Q.Explain user authentication in OS in detail
User authentication is the process by which an operating system verifies the identity of
someone who is trying to access the system. It ensures that only authorized users can log in
and use resources.
It acts like a security guard who checks who you are before letting you in.
Enables access control (users only get what they are allowed)
o A secret password
The OS compares the entered password with the one stored securely (often as a
hashed value).
2. Biometric Authentication
o Fingerprint
o Face recognition
o Iris scan
4. Smart Cards
2. Password Verification
→ Compares entered password with the stored hash
3. Authentication Decision
Factors of authentication:
1. Single Factor Authentication.: Single factor authentication requires only a single type
of authentication to successfully access the data. For Example , Mobile Phones , once
you have entered the pin and if the pin is correct you can access the mobile phone .
2. Two factor authentication: two-factor authentication requires two different phases of
authentication in order to successfully access the data . for example atm . you must
put your debit card first as the first phase of authentication , and then after entering
enough details you have to enter the pin (2nd phase of authentication).
Confidentiality
Integrity
Availability
Access Control
This includes:
This includes:
Each file or folder has a set of permissions based on who is trying to access it:
1. User Authentication
Verifies user identity before access.
Methods:
o Passwords
o Biometrics
2. Encryption
Example:
Multi-Level Database Security (MLS) is a security model used in databases where data is
classified at different security levels This model is commonly used in military, defense, and
government systems.
Level Description
Confidentiality
Integrity
Availability
Access Control
This includes:
This includes:
Each file or folder has a set of permissions based on who is trying to access it:
Explanation: Microsoft regularly releases updates to fix bugs and security holes. If
these patches are not installed, the system remains vulnerable.
Explanation: RDP allows remote access to the desktop. Weak RDP settings can let
attackers brute-force into the system.
MODULE 6:
Explain Web Security: Web security is the practice of protecting websites, web
applications, and online services from cyber threats. It ensures that users' data and
transactions remain confidential, secure, and trustworthy.
2. Access Control
Handshake protocol
Change cipher spec protocol
Alert protocol
HTTP
How SSL Works – Step-by-Step
1. Client Hello
2. Server Hello
3. Certificate Verification
Browser generates a session key (symmetric key) and encrypts it using the server’s
public key from the certificate.
Domain name
Organization info
Certificate Authority (CA)
Validity period
Digital signature of CA
Ensures privacy
Prevents hijacking
Prevents data leakage
Agreement on Encryption algorithm.
2. Server Hello
3. Certificate Verification
Browser generates a session key (symmetric key) and encrypts it using the server’s
public key from the certificate.
Feature HTTP (HyperText Transfer Protocol) HTTPS (HyperText Transfer Protocol Secure)
12. SEO
No SEO boost Google gives ranking boost to HTTPS
Advantage
Explain SSH (secure Shell): Secure shell is a network protocol that uses secure remote
access and control of computers over an unsecured network.
The SSH client (e.g., your computer) sends a request to connect to the SSH server
(e.g., remote Linux machine).
4. User Authentication
o Password, or
o Run commands
Session Management :
Session management is the process of starting , handling and
terminating a session between user and a server. It observes the activity and requests made
by user during the session and . whenever a users authenticates and start a session by
accepting its cookies the activities made by user and the requests made by user are
observed where the user moves after login in the site and session can hold the data like
what is in the cart and which part of the website have been visited the most.
Session lifecycle:
3. Use: The user can then make several requests to the session host as long as the session is
active and can access the resources as per the authorization she has. On each request, the
client software attaches the session secret (session ID) that was established in the previous
step.
4. Terminate Session: Once the user is done with all the required interactions and has no
further requests to make, then she can terminate the session by logging out. The session can
also terminate by itself due to inactivity to avoid allowing someone else to hijack
an unused session.
Explain Cookie :
Cookies are small text files that are located in the browser to store
information from a browsing session . cookies are used for session management and other
purposes as well . note when ever you authenticate yourself on a website the website send
cookie request when you accept those request the website can now see your login
credentials your activity on the web your cart everything . cookies are not just used to store
information but cookies can identify and understand the user surfing and then personalize it
according to user .
Cookies can store user prefrences and from the next time when user visits the website it
can adapt the behaviuor and directly ask user to restore the pages or go to that page again .
A cookie contains:
Field Description
Session hijacking:
Session hijacking means when an attacker steals your session id and
o=takes over a valid session . attacker uses this session id and uses the website
impersonating as you.
How it works : whenever you visit an website the website gives browser a valid session id
the attacker steals your session id via (sniffing , XSS) and uses the websites and you wont
even have any idea.
Packet Sniffing -On public Wi-Fi, attacker reads traffic and captures session ID (if not using
HTTPS)
To prevent this use HTTPS or vpn while being on a public wifi .using https will encrypt your
session.
Real life example : you're at a coffee shop logged into a bank on your laptop. If a hacker on
the same Wi-Fi steals your "access ticket" (session ID), they can use it to pretend to be you—
even without knowing your password.
Web bugs :
web bugs are very tiny images on the web pages that are invisible to users. These images
are present on the web pages that collect information.it is a type of malicious code that
allows third party websites to have our data .
IP Address
Name
Host name
Browser type and version
User details
Cookies
Paths
These bugs are commonly referred as :
Tracking bug
Tag
Web tag
Page tag
Pixel tag
1*1 GIF
Clear GIF
These bugs could be very small like 1*1 GIF so being invisible to human eye , nut even if it is
visible it doesn’t change and the bug collect and stores data.
Clickjacking: clickjacking is an attack where the user is maliciously tricked into clicking on
something. This something is usually a link . the attacker puts something exciting on the
webpage and on the link of that exciting prize is the link of this mailicious attack.example the
attacker puts an exciting prize on any webpage like ‘ click here to get your free phone reward
by seeing this ome users get trapped and clixk on that link this leads them to an
attack .where the attackers wanted them to visist they just clicked his link and now he has
the access of that device .
One of the most trending and recent clickjacking example is image downloading . the
attacker sends an image on the whatsapp of the client if the persons clicks on the download
icon then the image gets downloaded and now the attacker has full access of the device .
Cursor jacking – In this the user has to put cursor in the marked area
Cookie jacking – In this the attacker takes the data from a cookie.