CryptoBox is a Python-based cryptographic tool that implements three powerful encryption algorithms:
- RSA (Rivest–Shamir–Adleman): An asymmetric encryption algorithm that uses public and private keys.
- DSA (Digital Signature Algorithm): Used to create digital signatures for verifying the authenticity and integrity of messages.
- AES (Advanced Encryption Standard): A symmetric encryption algorithm for encrypting and decrypting data using a shared secret key.
This project allows users to encrypt and decrypt messages using RSA, DSA, and AES, as well as sign and verify messages using DSA.
- RSA Encryption/Decryption: Securely encrypt and decrypt messages using public/private key pairs.
- DSA Signing/Verification: Create and verify digital signatures to ensure the authenticity and integrity of messages.
- AES Encryption/Decryption: Encrypt and decrypt data using a shared secret key.
To use this tool, you need Python 3 and the pycryptodome library installed on your system. You can install it using the following command:
pip install pycryptodomeClone the Repository If you have not already, clone the repository using the following command:
git clone https://github.com/Dharan10/Cryptbox.git
cd CryptoBoxTo start using CryptoBox, you can run the Python script (text_encrypter.py):
python3 text_encrypter.pyEnter Text for Encryption/Signing After running the script, it will prompt you to enter the text you want to encrypt or sign.
Enter a text to perform Encryption:Once you enter the text, the tool will:
Encrypt the text using RSA (asymmetric encryption).
Encrypt the text using AES (symmetric encryption).
Sign the text using DSA (digital signature).
Verify the signature using DSA.RSA is an asymmetric encryption algorithm, meaning it uses a pair of keys:
- Public Key: For encryption.
- Private Key: For decryption.
- A message is encrypted using the recipient's public key.
- The recipient decrypts it using their private key.
- Secure data transmission, such as exchanging sensitive information between parties.
- Public key encrypts the message:
Hello. - Result: Ciphertext (garbled, secure form).
- Private key decrypts the ciphertext back to:
Hello.
DSA is used for digital signatures to:
- Prove the authenticity of a message.
- Ensure the message has not been altered (integrity).
- The sender generates a digital signature for the message using their private key.
- The recipient verifies the signature using the sender’s public key.
- Signing documents, software distribution, or digital certificates.
- Private key signs the message:
Transaction Approved. - Result: A unique signature attached to the message.
- Public key verifies that the signature is valid and belongs to the sender.
AES is a symmetric encryption algorithm, meaning it uses a single key for:
- Encryption: Convert plaintext to ciphertext.
- Decryption: Convert ciphertext back to plaintext.
- The same secret key encrypts and decrypts the message.
- The key must be shared securely between the sender and receiver.
- Encrypting data at rest (stored data) or in transit (e.g., Wi-Fi security).
- Secret key encrypts:
Confidential Info. - Result: Ciphertext (unreadable form).
- Same secret key decrypts the ciphertext back to:
Confidential Info.
| Feature | RSA | DSA | AES |
|---|---|---|---|
| Type | Asymmetric encryption | Digital signatures | Symmetric encryption |
| Keys | Public/Private | Private for signing, Public for verifying | Single key for encryption/decryption |
| Speed | Slower | Faster | Fastest |
| Use Case | Secure data transmission | Authenticity and Integrity | Data encryption |
Let’s say Alice wants to send a secret message and verify her identity:
- Alice uses Bob’s public key to encrypt:
Meet me at 5 PM. - Bob decrypts it using his private key.
- Alice signs the message with her private key.
- Bob verifies Alice’s identity using her public key.
- Alice and Bob agree on a shared secret key.
- Alice encrypts the message with the key.
- Bob decrypts it using the same key.
This ensures confidentiality (AES), authentication (DSA), and secure communication (RSA).
