Generating a 2048‑bit RSA key pair, encrypting with the public key, decrypting with the private key, and documenting outputs
This repository documents Priyadharshini Rengaramanujam's RSA assignment: generating a 2048-bit RSA key pair, encrypting a message with the public key, and decrypting it with the private key, including captured program output. citeturn10search1turn10search2
docs/RSA assignment.pdf— Output evidence (screenshots/logs showing input, encrypted data, and decrypted message).src/rsa_encryption.py— Working Python script using the cryptography library (RSA, OAEP with SHA-256).BLOG.md— Lessons learned.
# (Optional) create a virtual environment
python -m venv .venv && source .venv/bin/activate # Linux/macOS
# On Windows: python -m venv .venv && .venv\Scripts\activate
pip install cryptography
python src/rsa_encryption.pyThe script will:
- Generate
private_key.pemandpublic_key.pem(2048-bit). - Prompt for a message, encrypt with the public key, and save as
encrypted_message.bin. - Decrypt using the private key and print the original plaintext.
Priyadharshini Rengaramanujam