Skip to content

anujvaghani0/Cryptography-and-Network-Security

Repository files navigation

Practical List 📃

Implement Caesar and Hill cipher. Both are substitution cipher. Analyze the strength of the cipher in terms of brute force attack and cryptanalysis attack. Suggest one way to improve and strengthen the cipher and analyze with respect to cryptanalysis attack.
Ceasar cipher-
Your plaintext is Hello, Welcome. The key used is 3. How Ceaser cipher will work?
Test case :
A B C
D E F
Hill Cipher -

    [ 17 17 5]    
K = [ 21 18 5]    
    [ 2  2  19]       

Plaintext = pay
Ciphertext = RRL

Implement rail Fence and transposition cipher. Both are permutation cipher. Analyze the strength of the cipher in terms of crypt analysis.
Rail fence.
Test case : Meetme
Ciphertext : MEMETE
Transposition
Key : 4312567
Plaintext: attackpostponeduntiltwoam
Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ

Implement Playfair Cipher. The plaintext is paired in two characters. Discuss the advantage of polyalphabetic cipher over monoalphabetic cipher.
Key = MONARCHY
Plaintext = ar mu hs ea
Ciphertext = RM CM BP IM

Write a program to implement Vigenere Cipher..

Write a program to implement Vernam Cipher.

6. GCD

Implement Euclid algorithm to find GCD.
GCD(16,12) = 4
GCD(12,4) = 0
Then 4 is the GCD(16,12)

Implement Euler’s totient function ф(n). It is defined as the number of positive integers less than n and relatively prime to n. Find ф(35) and ф(37). Observe the value and analyze the behavior of totient function.

Implement extended Euclidean Algorithm for finding inverse.

Implement RSA algorithm.
Take two prime numbers p, q
n=pxq
Initially take encryption key such that it is relatively prime with ф(n).
Find out decryption key.
Take plaintext message M, Ciphertext C=Me mod n.
To get plaintect from ciphertext M=Cd mod n.
Test case :
Two prime numbers 17,11
Encryption key = 7
Decryption key = 23
M=88, C=11

References

About

Scripts that illustrate basic cryptography 🔑 concepts!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages