Skip to main content

A Python library that lets you experiment with the mathematics of the Rivest–Shamir–Adleman (RSA) cryptosystem.

Project description

MARSA is a Python library that lets you experiment with the mathematics of the Rivest–Shamir–Adleman (RSA) cryptosystem.

Badge Badge

📋 Quick Guide

Installation

You can install MARSA using pip. Simply run the following command in your terminal or command prompt:

pip install marsa

Key Generation

To generate a key pair, import the rsa module from the marsa package and create an instance of the KeyPair class:

from marsa import rsa

key_pair = rsa.KeyPair()

Encryption

To encrypt, create an instance of the Encryptor class with the public key from your KeyPair object and use the encrypt() method:

encryptor = rsa.Encryptor(key_pair.public_key)
secret_message = encryptor.encrypt(message)

If you don't have access to the KeyPair object, you can manually create a key by using the Key class:

public_key = rsa.Key(product, exponent)

Decryption

Decryption works similar to encryption. If you need to decrypt, create an instance of the Decryptor class with the private key from your KeyPair object and use the decrypt() method:

decryptor = rsa.Decryptor(key_pair.private_key)
message = decryptor.decrypt(secret_message)

🛠️ Software

Developer

Built by Justine Paul Vitan as a solo project to demonstrate his knowledge in cryptography and number theory. The source code of this project is open and available to the public via GitHub for transparency and open-source collaboration.

License

This project is under the MIT license. Please read the terms and conditions stated within the license before attempting any modification or distribution of the software.

⚠️️ Warning

Production Use

MARSA is intended solely for educational purposes to illustrate the fundamental concepts of RSA encryption and decryption. It is not suitable for use in production environments where security is paramount. Please be aware that this implementation lacks essential security features, such as proper padding schemes, and should not be relied upon for real-world applications. For secure RSA implementations suitable for production use, consider utilizing established cryptographic libraries and frameworks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marsa-1.0.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page