A simple library for secure text encryption and decryption using salted password-based encryption.
Project description
SecureLock
SecureLock is a lightweight Python library for securely encrypting and decrypting text using a password. It utilizes salted key derivation and XOR-based encryption to ensure the integrity and security of your data.
Features
- Compact design: Only two functions,
lock()andunlock(). - Salted encryption: Each encryption is unique due to a randomly generated salt.
- Key stretching: Uses SHA-256 hashing to derive a secure encryption key from the password.
- Supports all Unicode characters.
Installation
pip install securelock
Usage
Encrypting Text
from securelock import lock
password = "strongpassword"
text = "This is a secret message!"
# Encrypt the text
locked_text = lock(text, password)
print("Locked Text:", locked_text)
Decrypting Text
from securelock import unlock
# Decrypt the text
unlocked_text = unlock(locked_text, password)
print("Unlocked Text:", unlocked_text)
Example Output
Locked Text: 4a6f1c2b... (encrypted hex string)
Unlocked Text: This is a secret message!
Security Notes
- Strong Passwords: Always use strong and unpredictable passwords for maximum security.
- Key Derivation: SecureLock uses SHA-256 with a randomly generated 32-byte salt, ensuring each encryption is unique.
- Brute-Force Resistance: The implementation is designed to make brute-forcing computationally expensive.
License
This project is licensed under the MIT License. See LICENSE for details.
Contributing
Feel free to submit issues or feature requests. Contributions are welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file securelock-1.0.1.tar.gz.
File metadata
- Download URL: securelock-1.0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a2839f1fdc421058e329aa9e50c7d561448f1fb66ec9766131e4a35ba8b3503
|
|
| MD5 |
303fc659bff89e17b594741311d216f0
|
|
| BLAKE2b-256 |
e8db39247d47bfd8f1ce02c6f05d8b5aee3c0a8d7262ecc9674bfb6f5b982ae0
|
File details
Details for the file securelock-1.0.1-py3-none-any.whl.
File metadata
- Download URL: securelock-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6368f0fb24a7dff9f915bdb20cb23c695e18e5c5ce56e611e7e673f82d2b4087
|
|
| MD5 |
dfd146f7dd18042c3478db455903c5d8
|
|
| BLAKE2b-256 |
9b0d74d40ef92e4e43c8521b3b2349fe3180075b2bc03bedadcedd70b30c0cde
|