# 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
Raw data
{
"_id": null,
"home_page": "https://github.com/TheVixhal/vixhal",
"name": "vixhal",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, vixhal, encrypt, decrypt, bytes, AES, store, retrieve, generate key, secure",
"author": "Vishal Singh Baraiya",
"author_email": "<thevishal010@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/18/36/efcf9ea311982d5468ea1acc2c4ffd9e2df5c688339ae06941315ea7862e/vixhal-0.0.4.tar.gz",
"platform": null,
"description": "# Vixhal\r\nVixhal 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.\r\n\r\n## Features\r\nSecure AES encryption for key-value pairs.\r\nEasy-to-use encryption and decryption functions.\r\nIn-memory storage for quick access.\r\nSuitable for web development, app development, AI, and data science.\r\n## Installation\r\nInstall the library via pip:\r\n\r\n`pip install vixhal`\r\n\r\n## Usage\r\nAfter installing the vixhal library, you can use the following methods:\r\n\r\n**1. generate_key():** Generates a random 256-bit AES key.\r\n\r\n```\r\nfrom vixhal import generate_key\r\n\r\nkey = generate_key()\r\nprint(f\"Generated Key: {key.hex()}\")\r\n```\r\n**2. encrypt_data(data: bytes, key: bytes) -> bytes** \r\n\r\nEncrypts the given data using AES encryption.\r\n\r\n```\r\nfrom vixhal import encrypt_data, generate_key\r\n\r\ndata = b\"my secret data\"\r\nkey = generate_key()\r\nencrypted_data = encrypt_data(data, key)\r\nprint(f\"Encrypted Data: {encrypted_data}\")\r\n```\r\n**3. decrypt_data(encrypted_data: bytes, key: bytes) -> bytes**\r\n \r\n Decrypts the given AES-encrypted data.\r\n\r\n```\r\nfrom vixhal import decrypt_data\r\n\r\ndecrypted_data = decrypt_data(encrypted_data, key)\r\nprint(f\"Decrypted Data: {decrypted_data}\")\r\n```\r\n**4. text_to_bytes(text: str, size: Optional[int] = None) -> bytes**\r\n\r\n Converts text into bytes.\r\n\r\n```\r\nfrom vixhal import text_to_bytes\r\n\r\ntext = \"hello world\"\r\nbyte_data = text_to_bytes(text)\r\nprint(f\"Byte Data: {byte_data}\")\r\n```\r\n**5. bytes_to_text(byte_data: bytes) -> str**\r\n\r\n Converts bytes back into text, handling non-printable characters.\r\n\r\n```\r\nfrom vixhal import bytes_to_text\r\n\r\ntext = bytes_to_text(byte_data)\r\nprint(f\"Text: {text}\")\r\n```\r\n**6. store_entry(key: str, value: str, store: dict) -> None**\r\n\r\n Stores a key-value pair securely in the provided dictionary using AES encryption.\r\n\r\n```\r\nfrom vixhal import store_entry\r\n\r\nstore = {}\r\nstore_entry(\"my_key\", \"my_value\", store)\r\n```\r\n**7. retrieve_entry(key: str, store: dict) -> Optional[str]**\r\n\r\n Retrieves a value for the given key from the dictionary, decrypting it in the process.\r\n\r\n```\r\nfrom vixhal import retrieve_entry\r\n\r\nretrieved_value = retrieve_entry(\"my_key\", store)\r\nprint(f\"Retrieved Value: {retrieved_value}\")\r\n```\r\n\r\n## In-Memory Storage\r\nThe 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.\r\n\r\n## Where and How to Use\r\nThis library can be useful in the following fields:\r\n\r\n* **Web Development:** Store and retrieve encrypted data for secure session management or token storage.\r\n\r\n* **App Development:** Handle local encryption for secure storage of sensitive data in mobile or desktop applications.\r\n\r\n* **Artificial Intelligence (AI):** Securely store and manage sensitive model configurations or parameters.\r\n\r\n* **Data Science:** Protect confidential data or credentials while processing sensitive datasets or performing computations.\r\n\r\n\r\n# Contribution\r\n\r\n**Github:** https://github.com/TheVixhal/vixhal\r\n",
"bugtrack_url": null,
"license": null,
"summary": "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.",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/TheVixhal/vixhal"
},
"split_keywords": [
"python",
" vixhal",
" encrypt",
" decrypt",
" bytes",
" aes",
" store",
" retrieve",
" generate key",
" secure"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "104b84322b3b56f19d85fdd5089c152ea3fc9e35b8f9049188b91216f6a36860",
"md5": "8d6f19e5a4fd0b8ab7b28a5357c50e0c",
"sha256": "b1ec9f9b84a2f9de419388930314eb6aaea4ac6d6491a6233f625d23173bcb83"
},
"downloads": -1,
"filename": "vixhal-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8d6f19e5a4fd0b8ab7b28a5357c50e0c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5539,
"upload_time": "2024-09-15T12:49:37",
"upload_time_iso_8601": "2024-09-15T12:49:37.715945Z",
"url": "https://files.pythonhosted.org/packages/10/4b/84322b3b56f19d85fdd5089c152ea3fc9e35b8f9049188b91216f6a36860/vixhal-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1836efcf9ea311982d5468ea1acc2c4ffd9e2df5c688339ae06941315ea7862e",
"md5": "7bd95944f7f2e6fc3338cea487cfa6e0",
"sha256": "44b8cb25b35fa2ba5d0450926aa1086143d9f6fa9d57d2f42d3f7ab4e72a340b"
},
"downloads": -1,
"filename": "vixhal-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "7bd95944f7f2e6fc3338cea487cfa6e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5155,
"upload_time": "2024-09-15T12:49:40",
"upload_time_iso_8601": "2024-09-15T12:49:40.204838Z",
"url": "https://files.pythonhosted.org/packages/18/36/efcf9ea311982d5468ea1acc2c4ffd9e2df5c688339ae06941315ea7862e/vixhal-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-15 12:49:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TheVixhal",
"github_project": "vixhal",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "vixhal"
}