Catalog PyPI
Back to packageRELEASE DETAILS

0.0.3

PyPI

aeif-lib

Encrypts and decrypts image files using AES encryption in GCM mode.

Published11 Jan 2024
Direct dependencies2
Transitive dependenciesNot calculated

README

Version 0.0.3 documentation

AEIF (AES Encrypted Image File) Library

The AEIF (AES Encrypted Image File) library is a Python library that provides functionality for encrypting and decrypting image files using the AES encryption algorithm.

Installation

You can install the AEIF library using pip:

pip install aeif-lib

Usage

Generating a key

To generate a key, you can use the genkey function:

from aeif_lib import genkey

# Generate a random key with the specified size
# (only 16, 24, and 32 bytes is supported) and save it to a file
key_path, key = genkey("path/to/save/key")

Encrypting an image

To encrypt an image, you can use the encrypt function:

from aeif_lib import AEIFManager, genkey, verify_hash

key_path, _ = genkey("path/to/save/key", 32)

# Create an AEIFManager object
# (key_path is optional but will be required for encryption/decryption if not set)
aeif = AEIFManager(key_path)

# Encrypt the image (key or key_path is optional if the key is already set)
aeif.encrypt("./img.png", "./img_e.aeif")

Decrypting an image

To decrypt an image, you can use the decrypt function:

from aeif_lib import AEIFManager

key_path = "path/to/the/key"

# Create an AEIFManager object
# (key_path is optional but will be required for encryption/decryption if not set)
aeif = AEIFManager(key_path)

# Decrypt the image (key or key_path is optional if the key is already set)
aeif.decrypt("./img_e.aeif", "./img_d.png")

# Verify the hash of the original image and the decrypted image
verify = verify_hash(("./img.png", "./img_d.png"))
print("Hashes match!" if verify else "Hashes do not match!")

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
pycryptodome
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pycryptodome >=3.19.0runtime
twine
Environment
{
  "extras": "",
  "marker": "extra == 'dev'",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
twine >=4.0.2 ; extra == 'dev'runtime

Distribution files

2 collected
aeif_lib-0.0.3-py3-none-any.whl

bdist_wheel · 4.09 KB · Python py3

Source file
aeif-lib-0.0.3.tar.gz

sdist · 3.95 KB · Python source

Source file

Repository

PENDING
pekgame/aeif-lib

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:20 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:5f28cce94ad5bee1359287b5ef1ba3943ca0abae0215ca985b3999fcd85bb2cd

Other collected versions

View all collected versions →