Skip to main content

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() and unlock().
  • 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!

Release files for securelock 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for securelock 1.0.1
File Size Uploaded
securelock-1.0.1.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for securelock 1.0.1
File Interpreter ABI Platform
securelock-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.5 kB

Release files / securelock-1.0.1.tar.gz

Download URL securelock-1.0.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0a2839f1fdc421058e329aa9e50c7d561448f1fb66ec9766131e4a35ba8b3503
BLAKE2b-256 checksum
How to use checksums
e8db39247d47bfd8f1ce02c6f05d8b5aee3c0a8d7262ecc9674bfb6f5b982ae0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.0

Release files / securelock-1.0.1-py3-none-any.whl

Download URL securelock-1.0.1-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6368f0fb24a7dff9f915bdb20cb23c695e18e5c5ce56e611e7e673f82d2b4087
BLAKE2b-256 checksum
How to use checksums
9b0d74d40ef92e4e43c8521b3b2349fe3180075b2bc03bedadcedd70b30c0cde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page