https://github.com/hsbc/encryption-helper-python
A Python CLI application for generating RSA public and private key pairs.
https://github.com/hsbc/encryption-helper-python
automation cryptography data-protection devops-tools encryption hsbc key-generation key-management open-source poetry-python public-key python python-rsa python-rsa-key-pairs-public-key-private-key rsa security
Last synced: 6 months ago
JSON representation
A Python CLI application for generating RSA public and private key pairs.
- Host: GitHub
- URL: https://github.com/hsbc/encryption-helper-python
- Owner: hsbc
- License: apache-2.0
- Created: 2024-07-26T13:06:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-11T21:22:19.000Z (about 1 year ago)
- Last Synced: 2024-11-11T22:26:20.065Z (about 1 year ago)
- Topics: automation, cryptography, data-protection, devops-tools, encryption, hsbc, key-generation, key-management, open-source, poetry-python, public-key, python, python-rsa, python-rsa-key-pairs-public-key-private-key, rsa, security
- Language: Python
- Homepage:
- Size: 713 KB
- Stars: 1
- Watchers: 0
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
Encryption Helper Python
A Python CLI application for generating RSA public and private key pairs using the cryptography library
Features •
Installation •
Usage •
Configuration •
Development •
License
## Features
Encryption Helper is a robust Python package designed to simplify the process of creating RSA key pairs. It leverages the [cryptography][0] library to offer:
- Generation of 2048-bit RSA key pairs
- Automatic saving of keys in PEM format
- Logging of key generation for debugging purposes
- Simple CLI interface for ease of use
## Installation
This package requires Python 3.8 or later and uses cryptography for cryptographic operations.
### Using Poetry (recommended)
Ensure you have Poetry installed, then follow these steps:
```bash
# Clone the repository
git clone https://github.com/hsbc/encryption-helper-python.git
cd encryption-helper-python
# Install dependencies (including cryptography)
poetry install
```
### Using pip
If you prefer to use pip:
```bash
# Clone the repository
git clone https://github.com/hsbc/encryption-helper-python.git
cd encryption-helper-python
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install the package and its dependencies (including cryptography)
pip install .
```
## Usage
### With Poetry
To generate an RSA key pair using Poetry:
```bash
poetry run encryption-helper
```
### With standard Python
If you installed the package using pip:
```bash
# If you're using a virtual environment, make sure it's activated
encryption-helper
```
Or run the module directly:
```bash
python -m encryption_helper
```
These commands will:
- Use cryptography to generate a 2048-bit RSA key pair
- Save the private key to `keys/pem/private-key.pem`
- Save the public key to `keys/pem/public-key.pem`
- Display both keys in the console
- Log the key generation process
## Configuration
The key generation process uses cryptography with the following specifications:
- Standard: PKCS#1
- Type: RSA
- Size: 2048 bits
To modify these settings, you'll need to edit the `generate_rsa_key()` function in `encryption_helper/main.py`. Refer to the cryptography documentation for more advanced configurations.
## Development
### With Poetry
To set up the development environment using Poetry:
```bash
# Create a virtual environment and install dependencies
poetry install
# Activate the virtual environment
poetry shell
# Run tests
pytest tests/
# Generate documentation
pydoc -w encryption_helper
```
### With standard Python
If you're not using Poetry:
```bash
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install development dependencies
pip install .[dev]
# Run tests
pytest tests/
# Generate documentation
pydoc -w encryption_helper
```
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
[0]: https://github.com/pyca/cryptography