This project includes Python implementations of several classical cryptographic algorithms and number theory utilities. The scripts demonstrate encryption techniques (like the Caesar and Vigenère ciphers), number theoretic functions (like GCD and Euler’s Totient), and basic cryptanalysis using the chi-square test.
-
Caesar-Cipher-Algorithm.py
Implements Caesar cipher encryption by shifting characters by a fixed key. It supports preserving punctuation and letter casing. -
Vigenere-Cipher-Algorithm.py
Implements the Vigenère cipher using a keyword. Includes both encryption and decryption functions. Supports an extended alphabet (e.g.,ÅÄÖ
). -
Chi-Square.py
Performs frequency analysis on Caesar-ciphered text using the chi-square test to detect the most likely shift key for decryption.
-
CoPrime.py
Finds a numbere
that is coprime with bothN
andT
using Python’smath.gcd()
function. -
Euler's-Totient.py
Computes Euler’s Totient Function φ(n) for various integers, useful for RSA key generation and number theory analysis. -
Greatest-Common-Divisor-GCD.py
Implements the Euclidean algorithm to calculate the greatest common divisor of two numbers. -
Prime-Factors.py
Calculates all prime factors of a given integer (or list of integers) using trial division.
SSP_Recursive_Backtracking.py
(Subset Sum Problem) Uses recursive backtracking to explore possible combinations of numbers that sum to a target value.
- Ensure you have Python 3 installed.
- To run a script, open a command prompt in the project directory and execute:
python Caesar-Cipher-Algorithm.py
- Modify the inputs within the script or integrate with
input()
as needed.
- Understand classical encryption methods and their strengths/weaknesses.
- Learn basic techniques of frequency-based cryptanalysis.
- Explore core number-theoretic concepts that underpin modern cryptography.
- Practice implementing real-world math-based problems in Python.