Skip to main content

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() 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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

securelock-1.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

securelock-1.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

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

Hashes for securelock-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0a2839f1fdc421058e329aa9e50c7d561448f1fb66ec9766131e4a35ba8b3503
MD5 303fc659bff89e17b594741311d216f0
BLAKE2b-256 e8db39247d47bfd8f1ce02c6f05d8b5aee3c0a8d7262ecc9674bfb6f5b982ae0

See more details on using hashes here.

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

Hashes for securelock-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6368f0fb24a7dff9f915bdb20cb23c695e18e5c5ce56e611e7e673f82d2b4087
MD5 dfd146f7dd18042c3478db455903c5d8
BLAKE2b-256 9b0d74d40ef92e4e43c8521b3b2349fe3180075b2bc03bedadcedd70b30c0cde

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page