This Python module provides functionality for generating and managing RSA and AES keys, encrypting and decrypting messages, and interacting with a KYC (Know Your Customer) API.
- Generate RSA key pairs (public and private keys).
- Import RSA public keys from PEM format.
- Generate symmetric AES keys.
- Encrypt and decrypt messages using AES encryption.
- Encrypt messages with a symmetric key and wrap the key using RSA encryption.
- Decrypt messages and unwrap the symmetric key using RSA decryption.
- Generate a URL for KYC API requests.
- Python 3.x
cryptography
libraryrequests
library
You can install the required libraries using pip:
pip install cryptography requests
To run the KYC application, follow these steps:
-
Clone the repository:
git clone https://github.com/okymikhael/kyc-satu-sehat.git cd kyc-satu-sehat
-
Install the required libraries:
Ensure you have Python 3.x installed, then run:
pip install cryptography requests
-
Run the application:
You can run the application by executing the following command in your terminal:
python app/main.py
-
Follow the usage instructions:
After running the application, follow the usage instructions provided in the "Usage" section to interact with the KYC class.
-
Instantiate the KYC class:
from main import KYC kyc = KYC()
-
Generate a URL for KYC:
Call the
generate_url
method with the agent's name and NIK:result = kyc.generate_url('Agent Name', 'Agent NIK') print(result)
-
Encrypt a message:
Use the
encrypt_message
method:encrypted_message = kyc.encrypt_message('Your message', public_key_pem)
-
Decrypt a message:
Use the
decrypt_message
method:decrypted_message = kyc.decrypt_message(encrypted_message, private_key_pem)
kyc = KYC()
result = kyc.generate_url('Doyok Putih', '################')
print("Result of generate_url:")
print(result)
This project is licensed under the MIT License.