Hey there! ๐ Welcome to my collection of cryptography algorithms implemented from your college assignments.
This repo contains various encryption, hashing, and key exchange implementations for learning and educational purposes.
Algorithm | Description | Time Complexity |
---|---|---|
Caesar | The classic substitution cipher that shifts characters by a fixed offset | O(n) |
Playfair | Digraph substitution cipher that encrypts pairs of letters | O(n) |
๐ก Example usage (click to expand)
// Caesar cipher example
String plaintext = "HELLO";
int shift = 3;
String encrypted = caesar.encrypt(plaintext, shift); // Returns "KHOOR"
Algorithm | Description | Security |
---|---|---|
RSA | Public-key cryptosystem for secure data transmission | Based on factoring large integers |
Diffie-Hellman | Method for securely exchanging cryptographic keys over public channels | Based on discrete logarithm problem |
โ๏ธ Implementation details (click to expand)
// RSA simplified example
KeyPair keys = RSA.generateKeyPair(1024);
String encrypted = RSA.encrypt("Secret message", keys.publicKey);
String decrypted = RSA.decrypt(encrypted, keys.privateKey);
Algorithm | Description | Output Size |
---|---|---|
MD5 | Widely used hash function producing a 128-bit hash value | 128 bits (16 bytes) |
Utility | Description | Used In |
---|---|---|
Euclidean | Algorithms for computing GCD and modular inverse | RSA, many crypto systems |
Buffer_Overflow | Demonstration of memory vulnerability | Security testing |
# Compile the Java file
javac RSA.java
# Run the program
java RSA
# Example output:
# Generated keys: (public_key, private_key)
# Encrypted: a7f12d8e...
# Decrypted: Hello, world!
# Compile with gcc
gcc Buffer_Overflow.c -o buffer
# Run the executable
./buffer
# Example output:
# Demonstrating buffer overflow vulnerability...
Found a bug? Have a better implementation? Want to add a new algorithm? I'd love your help!
# Fork this repository
# Create your feature branch
git checkout -b cool-new-feature
# Commit your changes
git commit -m 'Added an awesome crypto algorithm'
# Push to the branch
git push origin cool-new-feature
# Open a Pull Request ๐
If this repo helped you understand crypto concepts better, consider giving it a star! Each star motivates me to add more algorithms and improve the existing ones! โจ