A comprehensive repository for cryptographic algorithms, protocols, and implementations. This project provides educational resources and practical examples of modern cryptographic techniques.
This repository serves as a centralized hub for cryptography concepts, implementations, and best practices. It includes symmetric encryption, asymmetric encryption, hashing algorithms, key exchange protocols, and digital signatures.
- Symmetric Cryptography: AES, DES, ChaCha20
- Asymmetric Cryptography: RSA, ECC, Diffie-Hellman
- Hash Functions: SHA-256, SHA-512, BLAKE2
- Digital Signatures: HMAC, DSA, ECDSA
- Key Derivation: PBKDF2, Argon2, Scrypt
- Educational Documentation: Detailed explanations and tutorials
- Practical Examples: Real-world implementation patterns
- Python 3.8+ (or language-specific requirements)
- pip/package manager
- Git
git clone https://github.com/Ali-hey-0/Cryptography-organization.git
cd Cryptography-organizationpip install -r requirements.txtfrom cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend
message = b"Hello, Cryptography!"
digest = hashes.Hash(hashes.SHA256(), backend=default_backend())
digest.update(message)
hash_result = digest.finalize()
print(hash_result.hex())from cryptography.fernet import Fernet
# Generate key
key = Fernet.generate_key()
cipher = Fernet(key)
# Encrypt
message = b"Secret message"
encrypted = cipher.encrypt(message)
# Decrypt
decrypted = cipher.decrypt(encrypted)
print(decrypted)from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
# Generate keys
private_key = rsa.generate_private_key(public_exponent=65537, key_size=2048)
public_key = private_key.public_key()
# Encrypt with public key
ciphertext = public_key.encrypt(b"Secret", padding=padding.OAEP(...))
# Decrypt with private key
plaintext = private_key.decrypt(ciphertext, padding=padding.OAEP(...))Cryptography-organization/
├── README.md
├── requirements.txt
├── symmetric/
│ ├── aes.py
│ ├── chacha20.py
│ └── des.py
├── asymmetric/
│ ├── rsa.py
│ ├── ecc.py
│ └── diffie_hellman.py
├── hashing/
│ ├── sha.py
│ ├── blake2.py
│ └── hmac.py
├── signatures/
│ ├── dsa.py
│ ├── ecdsa.py
│ └── rsa_sign.py
├── key_derivation/
│ ├── pbkdf2.py
│ ├── argon2.py
│ └── scrypt.py
└── examples/
├── secure_file_encryption.py
├── key_exchange.py
└── digital_signatures.py
Symmetric algorithms use the same key for encryption and decryption. Fast and efficient for large data.
Asymmetric algorithms use public and private key pairs. Enable secure key exchange and digital signatures.
One-way functions that produce fixed-size digests. Used for integrity verification and password storage.
Prove authenticity and non-repudiation using asymmetric cryptography.
Functions to derive cryptographic keys from passwords or other sources securely.
⚠️ Never hardcode secrets in source code- 🔐 Use established libraries like
cryptographyorPyCryptodome - 🔑 Implement proper key management with secure storage
- 🛡️ Apply authenticated encryption (AES-GCM, ChaCha20-Poly1305)
- 🚫 Avoid deprecated algorithms (DES, MD5, SHA-1)
- 🔄 Use random nonces/IVs for each encryption operation
- ✅ Validate all inputs before cryptographic operations
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit changes (
git commit -m 'Add your feature') - Push to branch (
git push origin feature/your-feature) - Open a Pull Request
- Follow PEP 8 guidelines
- Add docstrings to all functions
- Include unit tests for new features
- Update documentation as needed
- NIST Cryptographic Standards
- Cryptography.io Documentation
- OWASP Cryptographic Storage Cheat Sheet
- RFC Standards for Cryptography
This project is licensed under the MIT License - see the LICENSE file for details.
This repository is for educational purposes. Do not use unreviewed cryptographic implementations in production systems. Always use peer-reviewed, well-tested libraries.
For questions or suggestions, please open an issue or contact the repository maintainers.
Last Updated: July 2026