A simple way to encode plain text, keeps the result sortable and partly searchable.
Project description
srndcipher
A simple way to encode plain text, keeps the result sortable and partly searchable.
Install
pip install srndcipher
Usage
import os
import srndcipher
cipher1 = srndcipher.SrndCipher(password="Your password")
data1 = os.urandom(1024)
data2 = cipher1.encrypt(data1)
data3 = cipher1.decrypt(data2)
assert data1 == data3
cipher2 = srndcipher.SrndCipher(password="Your password", force_text=True)
data1 = "your plain message"
data2 = cipher2.encrypt(data1)
data3 = cipher2.decrypt(data2)
assert data1 == data3
Notice
- SrndCipher instance init takes about 0.6 second time, so try to keep the instance reusable.
Test Passed With Python Versions
- python 2.7
- python 3.2
- python 3.3
- python 3.4
- python 3.5
- python 3.6
- python 3.7
- python 3.8
- python 3.9
- python 3.10
- python 3.11
Releases
v0.5.0
- First relase.
v0.6.2
- Set SrndCipher.default_result_encoder to cipherutils.Utf8Encoder().
- Works with fastutils>=0.42.11.
v0.6.3
- Doc update.
- Deps on zenutils.
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
srndcipher-0.6.3.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file srndcipher-0.6.3.tar.gz
.
File metadata
- Download URL: srndcipher-0.6.3.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017d26a55290a502f2751e549ce4499f44349dadbfbe0d4d82134b1b8bfa8c3c |
|
MD5 | 50754a37bf90f22a875ec01edbfbdb8b |
|
BLAKE2b-256 | 023598a48e8457e7f778c080f3ebe1ef1ff164d3c124d27f557f166b72d1037e |
File details
Details for the file srndcipher-0.6.3-py3-none-any.whl
.
File metadata
- Download URL: srndcipher-0.6.3-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be44141f4f807546e80fb806d997f17013a8343ce3f2464bc21474559e371b22 |
|
MD5 | 6ac82361b69502d72c543e4e24a338cc |
|
BLAKE2b-256 | 65487c94ba51051217e2d62562eaecb96a27bd51a570c7d629b9651c6f3bd3a4 |