Dglobal Drex provides functions for secure data encryption, decryption, key generation, and hashing.
You can install the library using pip:
pip install dglobal-drex
from dglobal-drex import generate_key, encrypt_data, decrypt_data
# Generate a secret key
secret_key = generate_key()
# Encrypt data
original_data = "Hello, world!"
encrypted_data = encrypt_data(original_data, secret_key)
# Decrypt data
decrypted_data = decrypt_data(encrypted_data, secret_key)
print(f"Original data: {original_data}")
print(f"Encrypted data: {encrypted_data}")
print(f"Decrypted data: {decrypted_data}")
generate_key()
: Generates a random key for encryption and decryption.encrypt_data(data, key)
: Encrypts the provided data using the given key.decrypt_data(encrypted_data, key)
: Decrypts the encrypted data using the key.
Contributions are welcome! Please open an issue or submit a pull request if you find any bugs or want to improve the library.
This project is licensed under the MIT License - see the LICENSE file for details.