1. Protocols 4.
Playfair Cipher
Definition: Basic Structure: Definition:
A protocol is a set of rules that allow devices to communicate on a network. 1. User Agent (UA): Encrypts pairs of letters using a 5x5 grid of letters created from a keyword.
Common Protocols and Examples: Software like Gmail, Outlook. Keyword: "MONARCHY"
• HTTP (HyperText Transfer Protocol): 2. Mail Transfer Agent (MTA): Grid:
o Used for web communication. Transfers mail between servers using SMTP. MONAR
o Example: When you open http://example.com, your browser uses HTTP to 3. Mail Delivery Agent (MDA): CHYBD
fetch the web page. Delivers the mail to the recipient's mailbox. E F G I/J K
• HTTPS (HTTP Secure): Flow Example: LPQST
o HTTP + encryption (SSL/TLS). You send an email to a friend using Gmail. UVWXZ
o Used for secure web communication like banking websites. • Your Gmail client (UA) connects to Google’s server using SMTP. Example: Encrypt “HELLO”
• TCP/IP: • The email is sent to your friend’s email server (like Yahoo). 1. Divide into digraphs: HE, LX, LO (replace repeated L with filler 'X')
o TCP ensures reliable data transfer (like phone calls). • Yahoo’s server (MDA) delivers the mail to your friend’s inbox. 2. Apply rules:
o IP handles addressing and routing (like a postal system). • Your friend reads it via Yahoo Mail (UA) using IMAP or POP3. o If same row: take letter to the right
• SMTP (Simple Mail Transfer Protocol): o If same column: take letter below
o Used to send emails. o Else: form rectangle, take opposite corners
o Example: Gmail sending an email uses SMTP. 3. Hill Cipher Encrypt "HE"
• POP3 / IMAP: H and E are in different rows and columns.
o Used to retrieve emails from the server. H (row 2, col 2), E (row 3, col 1)
2. Email Architecture → Cipher = C F
Encrypt "LX"
L (row 4, col 1), X (row 5, col 4)
→ Cipher = S U
Encrypt "LO"
L (row 4, col 1), O (row 1, col 2)
→ Cipher = P M
Final Ciphertext: CFSUPM
5. DES Structure (Data Encryption Standard)
Definition:
A symmetric block cipher that encrypts 64-bit blocks of plaintext using a 56-bit key.
DES Steps (Simplified): Step 1: Compute nn and ϕ(n)\phi(n)
1. Initial Permutation (IP) Step 4: Decryption
Step 2: Public Key and Private Key
2. 16 Rounds of Processing:
o Each round uses a different subkey.
o Applies substitution and permutation using Feistel structure. Step 3: Encryption
3. Final Permutation (FP)
Final Answer:
Example:
• Encrypted Message (C): 51
Let’s say the plaintext is:
• Decrypted Message (M): 8
01110010 01101001 (binary for "ri")
• Apply Initial Permutation.
• Divide into two 32-bit halves.
7.FTP protocols in Computer Networks (CN):
• For 16 rounds:
o Apply expansion, substitution, permutation, and XOR with subkey.
• Apply Final Permutation to get the cipher text.
Definition:
FTP (File Transfer Protocol) is a standard network protocol used to transfer files
6.RSA encryption and decryption step-by-step based on the given: between a client and server over a TCP/IP network, such as the Internet.
Given:
• p=7p = 7 Working:
• q=11q = 11 • FTP uses two separate connections:
• e=17e = 17 1. Control Connection (Port 21): Used for sending commands and responses.
• M=8M = 8 (message) 2. Data Connection (Port 20 or dynamic): Used for transferring actual files.
Modes of FTP: Example Mechanisms:
1. Active Mode: Server initiates the data connection to the client. • Symmetric Encryption (e.g., AES)
2. Passive Mode: Client initiates both control and data connections (used in firewalled • Asymmetric Encryption (e.g., RSA)
networks). • Message Digest (e.g., SHA-256)
Key FTP Commands: • Digital Signatures
• USER – Sends the username. • Firewalls and VPNs
• PASS – Sends the password. Diagram
• LIST – Lists directory contents. [Sender] → [Security Mechanism] → (Insecure Channel) → [Security Mechanism] →
• RETR – Retrieves a file from server. [Receiver]
• STOR – Uploads a file to the server.
9. Types of Cryptography in Computer Networks – 5 Marks
Advantages:
• Reliable file transfer protocol. 1. Symmetric Key Cryptography (Secret Key Cryptography):
• Supports authentication. • Uses one single key for both encryption and decryption.
• Can transfer large files. • The sender and receiver must share the same key securely.
• Fast and efficient for large amounts of data.
Disadvantages:
• Examples: AES, DES, RC4
• Plain FTP is not secure (data sent in plaintext).
• Can be blocked by firewalls (especially active mode).
2. Asymmetric Key Cryptography (Public Key Cryptography):
• Uses two keys: a public key for encryption and a private key for decryption.
8.Network Security Model (Computer Networks) – 5 Marks
• The public key can be shared openly, while the private key is kept secret.
Definition:
• Provides high security, but slower than symmetric cryptography.
A Network Security Model defines the framework and mechanisms used to secure
• Examples: RSA, ECC, ElGamal
communication over an untrusted network (like the Internet) to ensure
confidentiality, integrity, authentication, and availability of data.
3. Hash Functions (Message Digest):
Basic Components:
• Converts data into a fixed-size hash value.
1. Sender – Originates the message.
• One-way function: cannot be reversed to obtain original data.
2. Receiver – Intended recipient of the message.
• Used for data integrity, digital signatures, and password storage.
3. Message – Data to be transmitted securely.
• Examples: MD5, SHA-1, SHA-256
4. Security Mechanism – Includes encryption, authentication, digital signatures, etc.
5. Attacker – A third party trying to intercept or modify data.
Security Services Provided:
1. Confidentiality – Ensures the message is readable only by the receiver (e.g.,
encryption).
2. Integrity – Ensures data is not altered during transmission.
3. Authentication – Verifies identity of sender/receiver.
4. Non-repudiation – Sender cannot deny sending the message.
5. Access Control – Restricts unauthorized access to data.