※下の方に日本語の説明があります。
ezenc: A Simple AES Encryption Library
Easily handle AES encryption without complexity.
Overview
ezenc is a Python library designed to simplify AES encryption. While AES encryption can be intricate and difficult to manage, ezenc offers a lightweight and intuitive API for encrypting and decrypting data effortlessly.
Key Features
- Easy AES Encryption: No need to handle complex encryption steps.
- Flexible Key Length: Any key length can be used. Internally, it is automatically converted to 256 bits via a hash function.
- Lightweight and Minimal: Focuses on simplicity and ease of use.
Installation
To install ezenc, simply add it to your project:
pip install ezenc
Usage
import ezenc
# Encryption
encrypted_data = ezenc.enc(b"hello!", b"test-key")
print(encrypted_data)
# Decryption
decrypted_data = ezenc.dec(encrypted_data, b"test-key")
print(decrypted_data) # Output: b'hello!'
How It Works
- The provided key is internally processed to a 256-bit value using a hash function.
- The encryption function (
enc) converts plaintext into an AES-encrypted byte sequence. - The decryption function (
dec) restores the original data using the same key.
Important Notes
- The key must be consistent for both encryption and decryption. If a different key is used, decryption will fail.
- The library ensures a fixed 256-bit key internally, so users don't have to worry about key length.
License
This project is open-source. Feel free to use and modify it.
ezenc: 簡単なAES暗号化ライブラリ
複雑なAES暗号をシンプルに
概要
ezenc は、AES暗号化を簡単に扱うためのPythonライブラリです。AES暗号は通常、扱いが難しく煩雑になりがちですが、ezenc を使えばシンプルなAPIで簡単にデータを暗号化・復号できます。
特徴
- 簡単なAES暗号化:複雑な処理なしで暗号化可能。
- 自由なキー長:キーの長さは自由で、内部でハッシュ関数を用いて256ビットに統一。
- 軽量 & 直感的:無駄を省いたシンプルな設計。
インストール
ezenc をプロジェクトに追加するには、以下のコマンドを実行してください。
pip install ezenc
使い方
import ezenc
# 暗号化
encrypted_data = ezenc.enc(b"hello!", b"test-key")
print(encrypted_data)
# 復号
decrypted_data = ezenc.dec(encrypted_data, b"test-key")
print(decrypted_data) # 出力: b'hello!'
仕組み
- 指定したキーは内部でハッシュ関数を用いて256ビットに変換されます。
enc関数で平文をAES暗号化し、バイト列として出力します。dec関数を使うと、同じキーを用いて元のデータを復元できます。
注意点
- 暗号化と復号で 同じキー を使用してください。異なるキーを使うと復号できません。
ezencは内部でキーを256ビットに統一するため、キーの長さを気にする必要はありません。
ライセンス
本プロジェクトはオープンソースです。自由に使用・改変してください。
Metadata
Release files for ezenc 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ezenc-0.1.1.tar.gz | 3.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ezenc-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / ezenc-0.1.1.tar.gz
| Download URL | ezenc-0.1.1.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d3e2cfc2cc58ff0fbb6482099cd095e3d39bda6eb99ab804c54420af1cf7793
|
|
BLAKE2b-256 checksum How to use checksums |
3691a3c5a20867a48f15f572318741da19a5e5b07b27a9355b913e26faf74a98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.3
|
Release files / ezenc-0.1.1-py3-none-any.whl
| Download URL | ezenc-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09730097ce807c6a3f07faa18634527a943bbb3ab40d6b14d18006071b5df813
|
|
BLAKE2b-256 checksum How to use checksums |
a2eb04e1791984734d4e663998c37b822376e145276856cc6fe53bd1ff6b789f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.3
|
Security for ezenc 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.