Skip to main content

A tool that can easily encrypt and decrypt. Utilizes the symmetric key cryptography method (AES).

Project description

※下の方に日本語の説明があります。

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

  1. The provided key is internally processed to a 256-bit value using a hash function.
  2. The encryption function (enc) converts plaintext into an AES-encrypted byte sequence.
  3. 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!'

仕組み

  1. 指定したキーは内部でハッシュ関数を用いて256ビットに変換されます。
  2. enc 関数で平文をAES暗号化し、バイト列として出力します。
  3. dec 関数を使うと、同じキーを用いて元のデータを復元できます。

注意点

  • 暗号化と復号で 同じキー を使用してください。異なるキーを使うと復号できません。
  • ezenc は内部でキーを256ビットに統一するため、キーの長さを気にする必要はありません。

ライセンス

本プロジェクトはオープンソースです。自由に使用・改変してください。

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

ezenc-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

ezenc-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file ezenc-0.1.1.tar.gz.

File metadata

  • Download URL: ezenc-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for ezenc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d3e2cfc2cc58ff0fbb6482099cd095e3d39bda6eb99ab804c54420af1cf7793
MD5 2039e7b282393f8132f196dc4531939b
BLAKE2b-256 3691a3c5a20867a48f15f572318741da19a5e5b07b27a9355b913e26faf74a98

See more details on using hashes here.

File details

Details for the file ezenc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ezenc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for ezenc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09730097ce807c6a3f07faa18634527a943bbb3ab40d6b14d18006071b5df813
MD5 8e10fddb9bac906f07afc76c1edc9521
BLAKE2b-256 a2eb04e1791984734d4e663998c37b822376e145276856cc6fe53bd1ff6b789f

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