0% found this document useful (0 votes)
4 views3 pages

Ns Algorithm

The document outlines various algorithms and steps for cryptographic techniques, including the Playfair and Hill ciphers for encryption, and the installation and usage of Wireshark and tcpdump for network packet observation. It also details the use of OpenSSL for secure communication, emphasizing confidentiality and integrity verification processes. Additionally, it describes methods for eavesdropping attacks and dictionary attacks in cybersecurity contexts.

Uploaded by

thomas.a10242
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Ns Algorithm

The document outlines various algorithms and steps for cryptographic techniques, including the Playfair and Hill ciphers for encryption, and the installation and usage of Wireshark and tcpdump for network packet observation. It also details the use of OpenSSL for secure communication, emphasizing confidentiality and integrity verification processes. Additionally, it describes methods for eavesdropping attacks and dictionary attacks in cybersecurity contexts.

Uploaded by

thomas.a10242
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

EX1B – Algorithm: Playfair Cipher

1. Start the program.


2. Input the key and plaintext message.
3. Convert both to uppercase, replace J with I, and remove spaces.
4. Remove duplicate letters from the key.
5. Add remaining A–Z letters (except J) to the key.
6. Fill the letters into a 5 × 5 matrix row-wise.
7. Split the plaintext into pairs of letters and add X if needed.
8. Find the positions of both letters in the matrix.
9. If letters are in the same row, replace with the next letter to the right.
10. If letters are in the same column, replace with the letter below.
11. Otherwise, swap columns (rectangle rule) to form encrypted pair.
12. Repeat for all pairs and display encrypted and decrypted text.

EX1C - Algorithm: Hill Cipher

1. Take plaintext input


2. Convert plaintext to uppercase
3. Remove non-alphabetic characters
4. Pad with 'X' until length is multiple of 5
5. Input 5×5 key matrix
6. Split plaintext into blocks of 5 letters
7. Convert letters to numbers (A=0 … Z=25)
8. Form a vector of size 5 from each block
9. Multiply key matrix (5×5) with vector (5×1)
10. Apply modulo 26 to results
11. Convert numbers back to letters
12. Form encrypted block
13. Repeat for all blocks
14. Concatenate encrypted blocks
15. Output final ciphertext

EX4 – Installation of Wireshark, tcpdump and Observation of Data Transfer in Client–


Server Communication
Step 1: Installation of Wireshark
1 Open a web browser and go to [Link]
2 Download the Wireshark installer for the operating system
3 Run the downloaded .exe installer file
4 Follow the setup wizard and install Npcap when prompted
5 Complete the installation
6 Restart the system if required

Step 2: Packet Capture during Client–Server Communication using Wireshark


1 Open the Wireshark application
2 Select the active network interface
3 Click Start Capture to begin capturing packets
4 Run a TCP or UDP client-server program to generate network traffic
5 Apply filters such as tcp or udp to display specific packets
6 Observe packet details like source IP, destination IP, port numbers
and protocol type

Step 3: Packet Observation during Client–Server Communication using


tcpdump
1 Open the Ubuntu terminal
2 Run the command sudo tcpdump -i any tcp
3 Enter the system password and observe TCP packet details
4 Run the command sudo tcpdump -i any udp
5 Analyze the packets
6 Stop the capture using Ctrl + C

EX5–
--------------
definition
--------------

OpenSSL is an open-source toolkit that implements SSL/TLS protocols and many cryptographic
algorithms for secure communication.
It provides command-line tools and libraries to perform encryption, decryption, key generation, hashing,
and digital signatures.

----------------------------------
Algorithm Steps for confidentiality
------------------------------------------

1)Start the process.


2)Create or obtain the plaintext message file that needs to be protected.
3)Generate the required cryptographic keys.
4)For symmetric encryption, generate a secret key.
5)For asymmetric encryption, generate a public key and private key pair.
6)Select the encryption algorithm (AES for symmetric or RSA for asymmetric encryption).
7)Provide the plaintext message as input to the encryption algorithm.
8)Apply the encryption process using the appropriate key.
9)The plaintext is converted into ciphertext to ensure confidentiality.
10)Store or transmit the encrypted ciphertext securely.
11)For decryption, provide the ciphertext as input.
12)Use the corresponding key (same secret key for symmetric encryption or private key for RSA).
13)Apply the decryption algorithm to convert ciphertext back to plaintext.
14)Display or store the recovered plaintext message.
15)Stop the process.

------------------------------------------------
Integrity Verification Algorithm
---------------------------------------

1)Start the process.


2)Create the message file to be verified.
3)Generate a message digest using SHA-256 hashing algorithm.
4)Store the generated hash value.
5)Sign the message using the sender’s private key.
6)Generate a digital signature file ([Link]).
7)At the receiver side, verify the signature using the sender’s public key.
8)Compare the generated hash with the received hash.
9)If both hashes match, the message integrity is confirmed.
10)Stop the process.

EX6A –Eavesdropping Attack using Wireshark


EAVESDROPPING
1. Create a Flask HTTP login program in a Python file.
2. Run the file using python [Link] in Command Prompt.
3. Copy the URL from CMD and open it in a browser.
4. Open Wireshark and select Adapter for Loopback Capture.
5. Start packet capture.
6. Enter username and password in the login page.
7. Apply http filter and select POST packet.
8. Expand HTML Form URL Encoded to view credentials.

DICTIONARY ATTACK

EX6B – Algorithm: Dictionary Attack

1. Create a text file with common passwords.


2. Write a Python program using hashlib.
3. Read passwords from the wordlist.
4. Hash the entered password using SHA-256.
5. Compare with hashes of wordlist passwords.
6. Run the program using python [Link].
7. Enter a password in CMD.
8. Display password found or not found.

You might also like