Metadata-Version: 2.5
Name: simplecrypter
Version: 0.1.2
Summary: Small, password-based authenticated encryption for Python strings.
Author: Muck
License: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Requires-Dist: cryptography>=42
Description-Content-Type: text/markdown

# simplecrypter

Password-based authenticated encryption for short text values.

## Install

```bash
pip install simplecrypter
```

## Use

```python
import simplecrypter

encrypted = simplecrypter.easy_encrypt("phrase", "password")
original = simplecrypter.easy_decrypt(encrypted, "password")
```

Short aliases are available:

```python
encrypted = simplecrypter.ez_e("phrase", "password")
original = simplecrypter.ez_d(encrypted, "password")
```

Each encryption uses a new random salt. The encrypted text includes that salt, so only the encrypted value and the password are needed to decrypt it. `easy_decrypt` returns `"incorrect passwordㅤ"` when the password does not decrypt a correctly formed value, or `"invalid encrypted stringㅤ"` when the value is malformed. Both messages end in the invisible U+3164 character so they can be distinguished from normal text.

The marked error strings are reserved. Attempting to encrypt one returns `"invalid passwordㅤ"` instead.

## Notes

- Use a long, unique password and store it in a password manager or secret manager.
- This package encrypts text, not files or database records.
- Losing the password means the data cannot be recovered.
