Skip to main content

A library designed for secure key-value storage using AES encryption. It provides functionality for generating AES keys, encrypting and decrypting data, and converting between text and bytes. The library is designed for in-memory storage, making it suitable for fast, temporary data handling.

Project description

Vixhal

Vixhal is a Python library designed for secure key-value storage using AES encryption. It provides functionality for generating AES keys, encrypting and decrypting data, and converting between text and bytes. The library is designed for in-memory storage, making it suitable for fast, temporary data handling.

Features

Secure AES encryption for key-value pairs. Easy-to-use encryption and decryption functions. In-memory storage for quick access. Suitable for web development, app development, AI, and data science.

Installation

Install the library via pip:

pip install vixhal

Usage

After installing the vixhal library, you can use the following methods:

1. generate_key(): Generates a random 256-bit AES key.

from vixhal import generate_key

key = generate_key()
print(f"Generated Key: {key.hex()}")

2. encrypt_data(data: bytes, key: bytes) -> bytes

Encrypts the given data using AES encryption.

from vixhal import encrypt_data, generate_key

data = b"my secret data"
key = generate_key()
encrypted_data = encrypt_data(data, key)
print(f"Encrypted Data: {encrypted_data}")

3. decrypt_data(encrypted_data: bytes, key: bytes) -> bytes

Decrypts the given AES-encrypted data.

from vixhal import decrypt_data

decrypted_data = decrypt_data(encrypted_data, key)
print(f"Decrypted Data: {decrypted_data}")

4. text_to_bytes(text: str, size: Optional[int] = None) -> bytes

Converts text into bytes.

from vixhal import text_to_bytes

text = "hello world"
byte_data = text_to_bytes(text)
print(f"Byte Data: {byte_data}")

5. bytes_to_text(byte_data: bytes) -> str

Converts bytes back into text, handling non-printable characters.

from vixhal import bytes_to_text

text = bytes_to_text(byte_data)
print(f"Text: {text}")

6. store_entry(key: str, value: str, store: dict) -> None

Stores a key-value pair securely in the provided dictionary using AES encryption.

from vixhal import store_entry

store = {}
store_entry("my_key", "my_value", store)

7. retrieve_entry(key: str, store: dict) -> Optional[str]

Retrieves a value for the given key from the dictionary, decrypting it in the process.

from vixhal import retrieve_entry

retrieved_value = retrieve_entry("my_key", store)
print(f"Retrieved Value: {retrieved_value}")

In-Memory Storage

The Vixhal library stores data in RAM. This provides high performance for temporary data storage in scenarios where fast access is crucial. However, if you require persistent storage, you can extend this system by saving encrypted data to disk or a database.

Where and How to Use

This library can be useful in the following fields:

  • Web Development: Store and retrieve encrypted data for secure session management or token storage.

  • App Development: Handle local encryption for secure storage of sensitive data in mobile or desktop applications.

  • Artificial Intelligence (AI): Securely store and manage sensitive model configurations or parameters.

  • Data Science: Protect confidential data or credentials while processing sensitive datasets or performing computations.

Contribution

Github: https://github.com/TheVixhal/vixhal

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

vixhal-0.0.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

vixhal-0.0.4-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file vixhal-0.0.4.tar.gz.

File metadata

  • Download URL: vixhal-0.0.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for vixhal-0.0.4.tar.gz
Algorithm Hash digest
SHA256 44b8cb25b35fa2ba5d0450926aa1086143d9f6fa9d57d2f42d3f7ab4e72a340b
MD5 7bd95944f7f2e6fc3338cea487cfa6e0
BLAKE2b-256 1836efcf9ea311982d5468ea1acc2c4ffd9e2df5c688339ae06941315ea7862e

See more details on using hashes here.

File details

Details for the file vixhal-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: vixhal-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for vixhal-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b1ec9f9b84a2f9de419388930314eb6aaea4ac6d6491a6233f625d23173bcb83
MD5 8d6f19e5a4fd0b8ab7b28a5357c50e0c
BLAKE2b-256 104b84322b3b56f19d85fdd5089c152ea3fc9e35b8f9049188b91216f6a36860

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