Metadata-Version: 2.3
Name: abcrypt-py
Version: 0.1.4
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Rust
Requires-Dist: pytest >=6.2.4 ; extra == 'test'
Requires-Dist: mypy >=0.900 ; extra == 'dev'
Requires-Dist: ruff >=0.1.3 ; extra == 'dev'
Provides-Extra: test
Provides-Extra: dev
License-File: LICENSE-APACHE
License-File: LICENSE-MIT
License-File: AUTHORS.adoc
Summary: Python bindings for abcrypt
Keywords: abcrypt,crypto
Home-Page: https://sorairolake.github.io/abcrypt/
Author: Shun Sakai <sorairolake@protonmail.ch>
Author-email: Shun Sakai <sorairolake@protonmail.ch>
License: Apache-2.0 OR MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://sorairolake.github.io/abcrypt/book/python/index.html
Project-URL: Repository, https://github.com/sorairolake/abcrypt
Project-URL: Issues, https://github.com/sorairolake/abcrypt/issues
Project-URL: Changelog, https://github.com/sorairolake/abcrypt/blob/develop/crates/python/CHANGELOG.adoc

<!--
SPDX-FileCopyrightText: 2022 Shun Sakai

SPDX-License-Identifier: Apache-2.0 OR MIT
-->

# Python Bindings for abcrypt

[![CI][ci-badge]][ci-url]
[![PyPI Version][pypi-version-badge]][pypi-version-url]
![PyPI Python Version][pypi-python-version-badge]
[![crates.io Version][crates-version-badge]][crates-version-url]
![MSRV][msrv-badge]
[![Docs][docs-badge]][docs-url]
![License][license-badge]

**abcrypt-py** is the Python bindings for the [`abcrypt`] crate.

## Usage

### Installation

To install this library:

```sh
pip install abcrypt-py
```

### Example

```py
from typing import Final

import abcrypt_py

DATA: Final[bytes] = b"Hello, world!\n"
PASSPHRASE: Final[bytes] = b"passphrase"

# Encrypt `DATA` using `PASSPHRASE`.
ciphertext = abcrypt_py.encrypt(DATA, PASSPHRASE)
assert ciphertext != DATA

# And extract the Argon2 parameters from it.
params = abcrypt_py.Params(ciphertext)
assert params.memory_cost == 19456
assert params.time_cost == 2
assert params.parallelism == 1

# And decrypt it back.
plaintext = abcrypt_py.decrypt(ciphertext, PASSPHRASE)
assert plaintext == DATA
```

### Documentation

See the [documentation][docs-url] for more details.

## Minimum supported Rust version

The minimum supported Rust version (MSRV) of this library is v1.74.0.

## Development

[maturin] is required for development of this library.

```sh
python3 -m venv venv
source venv/bin/activate
maturin develop
pip3 install abcrypt-py[test,dev]
```

## Changelog

Please see [CHANGELOG.adoc].

## Contributing

Please see [CONTRIBUTING.adoc].

## License

Copyright &copy; 2022&ndash;2024 Shun Sakai (see [AUTHORS.adoc])

This library is distributed under the terms of either the _Apache License 2.0_
or the _MIT License_.

This project is compliant with version 3.0 of the [_REUSE Specification_]. See
copyright notices of individual files for more details on copyright and
licensing information.

[ci-badge]: https://img.shields.io/github/actions/workflow/status/sorairolake/abcrypt/CI.yaml?branch=develop&style=for-the-badge&logo=github&label=CI
[ci-url]: https://github.com/sorairolake/abcrypt/actions?query=branch%3Adevelop+workflow%3ACI++
[pypi-version-badge]: https://img.shields.io/pypi/v/abcrypt-py?style=for-the-badge&logo=pypi
[pypi-version-url]: https://pypi.org/project/abcrypt-py/
[pypi-python-version-badge]: https://img.shields.io/pypi/pyversions/abcrypt-py?style=for-the-badge&logo=python
[crates-version-badge]: https://img.shields.io/crates/v/abcrypt-py?style=for-the-badge&logo=rust
[crates-version-url]: https://crates.io/crates/abcrypt-py
[msrv-badge]: https://img.shields.io/crates/msrv/abcrypt-py?style=for-the-badge&logo=rust
[docs-badge]: https://img.shields.io/docsrs/abcrypt-py?style=for-the-badge&logo=docsdotrs&label=Docs.rs
[docs-url]: https://docs.rs/abcrypt-py
[license-badge]: https://img.shields.io/crates/l/abcrypt-py?style=for-the-badge
[`abcrypt`]: https://crates.io/crates/abcrypt
[maturin]: https://www.maturin.rs/
[CHANGELOG.adoc]: https://github.com/sorairolake/abcrypt/blob/develop/crates/python/CHANGELOG.adoc
[CONTRIBUTING.adoc]: https://github.com/sorairolake/abcrypt/blob/develop/CONTRIBUTING.adoc
[AUTHORS.adoc]: https://github.com/sorairolake/abcrypt/blob/develop/AUTHORS.adoc
[_REUSE Specification_]: https://reuse.software/spec/

