# MareArts Crystal
MareArts Crystal is a Python package for encryption, decryption, and serial key management. It provides a simple interface for generating and validating serial keys, encrypting and decrypting strings and files, and performing date-based operations.
## Installation
Install MareArts Crystal using pip:
```bash
pip install marearts-crystal
```
## Usage
Here's a comprehensive guide on how to use MareArts Crystal:
```python
from marearts_crystal import ma_crystal
# Initialize with a secret key
secret_key = "your_secret_key_here"
skm = ma_crystal(secret_key)
# Generate a serial key
username = "john_doe"
start_date = "2023-07-01"
end_date = "2023-12-31"
serial_key = skm.generate_serial_key(username, start_date, end_date)
print(f"Generated Serial Key: {serial_key}")
# Validate the serial key
validated_start, validated_end = skm.validate_serial_key(username, serial_key)
print(f"Validated Start Date: {validated_start}")
print(f"Validated End Date: {validated_end}")
# Date validation
if skm.validate_date("2024-07-01", "2024-12-31"):
print("Date range is valid")
else:
print("Date range is invalid")
# Get today's date
print("Today's date:", skm.get_today_date())
# Generate end dates
print("Tomorrow:", skm.generate_end_date(0, 0, 1))
print("Next month:", skm.generate_end_date(0, 1, 0))
print("Next year:", skm.generate_end_date(1, 0, 0))
# Try with an invalid key
invalid_result = skm.validate_serial_key(username, "invalid_key")
print(f"Invalid Key Result: {invalid_result}")
invalid_result = skm.validate_serial_key("wrong_name", serial_key)
print(f"Invalid Key Result: {invalid_result}")
# String encryption and decryption
original_string = "Hello, MareArts Crystal!"
encrypted = skm.encrypt_string(original_string)
print(f"Encrypted: {encrypted}")
decrypted = skm.decrypt_string(encrypted)
print(f"Decrypted: {decrypted}")
# Decryption with wrong key
wrong_key = "wrong_secret_key"
wrong_skm = ma_crystal(wrong_key)
wrong_decryption = wrong_skm.decrypt_string(encrypted)
print(f"Decryption with wrong key: {wrong_decryption}")
# File encryption and decryption
input_filename = "example.bin" # This can be any file, binary or text
output_encrypted_filename = "example_encrypted.bin"
# Read and encrypt the file
with open(input_filename, "rb") as file:
file_content = file.read()
encrypted_content = skm.encrypt_data(file_content)
# Save the encrypted content
with open(output_encrypted_filename, "wb") as file:
file.write(encrypted_content)
print(f"File '{input_filename}' has been encrypted and saved as '{output_encrypted_filename}'")
# Decrypt the file
input_encrypted_filename = output_encrypted_filename
output_decrypted_filename = "example_decrypted.bin"
# Read and decrypt the file
with open(input_encrypted_filename, "rb") as file:
encrypted_content = file.read()
decrypted_content = skm.decrypt_data(encrypted_content)
if decrypted_content:
# Save the decrypted content
with open(output_decrypted_filename, "wb") as file:
file.write(decrypted_content)
print(f"File '{input_encrypted_filename}' has been decrypted and saved as '{output_decrypted_filename}'")
else:
print("Decryption failed. The file might be corrupted or the wrong key was used.")
```
## Features
- Serial key generation and validation
- Date validation and manipulation
- String encryption and decryption
- File encryption and decryption
- Secure key management
## License
This project is licensed under the MIT License
## Support
www.marearts.com
Raw data
{
"_id": null,
"home_page": "https://www.marearts.com",
"name": "marearts-crystal",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.9",
"maintainer_email": null,
"keywords": "encryption, decryption, cython",
"author": "MareArts",
"author_email": "MareArts <hello@marearts.com>",
"download_url": null,
"platform": null,
"description": "# MareArts Crystal\n\nMareArts Crystal is a Python package for encryption, decryption, and serial key management. It provides a simple interface for generating and validating serial keys, encrypting and decrypting strings and files, and performing date-based operations.\n\n## Installation\n\nInstall MareArts Crystal using pip:\n\n```bash\npip install marearts-crystal\n```\n\n## Usage\n\nHere's a comprehensive guide on how to use MareArts Crystal:\n\n```python\nfrom marearts_crystal import ma_crystal\n\n# Initialize with a secret key\nsecret_key = \"your_secret_key_here\"\nskm = ma_crystal(secret_key)\n\n# Generate a serial key\nusername = \"john_doe\"\nstart_date = \"2023-07-01\"\nend_date = \"2023-12-31\"\nserial_key = skm.generate_serial_key(username, start_date, end_date)\nprint(f\"Generated Serial Key: {serial_key}\")\n\n# Validate the serial key\nvalidated_start, validated_end = skm.validate_serial_key(username, serial_key)\nprint(f\"Validated Start Date: {validated_start}\")\nprint(f\"Validated End Date: {validated_end}\")\n\n# Date validation\nif skm.validate_date(\"2024-07-01\", \"2024-12-31\"):\n print(\"Date range is valid\")\nelse:\n print(\"Date range is invalid\")\n\n# Get today's date\nprint(\"Today's date:\", skm.get_today_date())\n\n# Generate end dates\nprint(\"Tomorrow:\", skm.generate_end_date(0, 0, 1))\nprint(\"Next month:\", skm.generate_end_date(0, 1, 0))\nprint(\"Next year:\", skm.generate_end_date(1, 0, 0))\n\n# Try with an invalid key\ninvalid_result = skm.validate_serial_key(username, \"invalid_key\")\nprint(f\"Invalid Key Result: {invalid_result}\")\n\ninvalid_result = skm.validate_serial_key(\"wrong_name\", serial_key)\nprint(f\"Invalid Key Result: {invalid_result}\")\n\n# String encryption and decryption\noriginal_string = \"Hello, MareArts Crystal!\"\nencrypted = skm.encrypt_string(original_string)\nprint(f\"Encrypted: {encrypted}\")\n\ndecrypted = skm.decrypt_string(encrypted)\nprint(f\"Decrypted: {decrypted}\")\n\n# Decryption with wrong key\nwrong_key = \"wrong_secret_key\"\nwrong_skm = ma_crystal(wrong_key)\nwrong_decryption = wrong_skm.decrypt_string(encrypted)\nprint(f\"Decryption with wrong key: {wrong_decryption}\")\n\n# File encryption and decryption\ninput_filename = \"example.bin\" # This can be any file, binary or text\noutput_encrypted_filename = \"example_encrypted.bin\"\n\n# Read and encrypt the file\nwith open(input_filename, \"rb\") as file:\n file_content = file.read()\nencrypted_content = skm.encrypt_data(file_content)\n\n# Save the encrypted content\nwith open(output_encrypted_filename, \"wb\") as file:\n file.write(encrypted_content)\nprint(f\"File '{input_filename}' has been encrypted and saved as '{output_encrypted_filename}'\")\n\n# Decrypt the file\ninput_encrypted_filename = output_encrypted_filename\noutput_decrypted_filename = \"example_decrypted.bin\"\n\n# Read and decrypt the file\nwith open(input_encrypted_filename, \"rb\") as file:\n encrypted_content = file.read()\ndecrypted_content = skm.decrypt_data(encrypted_content)\n\nif decrypted_content:\n # Save the decrypted content\n with open(output_decrypted_filename, \"wb\") as file:\n file.write(decrypted_content)\n print(f\"File '{input_encrypted_filename}' has been decrypted and saved as '{output_decrypted_filename}'\")\nelse:\n print(\"Decryption failed. The file might be corrupted or the wrong key was used.\")\n```\n\n## Features\n\n- Serial key generation and validation\n- Date validation and manipulation\n- String encryption and decryption\n- File encryption and decryption\n- Secure key management\n\n## License\n\nThis project is licensed under the MIT License\n\n\n## Support\n\nwww.marearts.com\n",
"bugtrack_url": null,
"license": null,
"summary": "marearts crystal for encryption and decryption",
"version": "1.0.6",
"project_urls": {
"Bug Tracker": "https://github.com/yourusername/marearts-crystal/issues",
"Homepage": "https://github.com/yourusername/marearts-crystal"
},
"split_keywords": [
"encryption",
" decryption",
" cython"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e63189cffeff90c0bd8cacc64b7e4dcdd25097aa139dc90715abe4f2f641dee4",
"md5": "d1f753885a87fff336acb96884ebbfcb",
"sha256": "722c078919c319840cf0aba103883914e64308e162d7762ce3f1910de70e259b"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp310-cp310-macosx_10_9_universal2.whl",
"has_sig": false,
"md5_digest": "d1f753885a87fff336acb96884ebbfcb",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<3.13,>=3.9",
"size": 100495,
"upload_time": "2025-03-14T16:40:15",
"upload_time_iso_8601": "2025-03-14T16:40:15.453836Z",
"url": "https://files.pythonhosted.org/packages/e6/31/89cffeff90c0bd8cacc64b7e4dcdd25097aa139dc90715abe4f2f641dee4/marearts_crystal-1.0.6-cp310-cp310-macosx_10_9_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b5639459eacbee363745a05978bfe45440892110e04b8c27f52ddfaca224ff2e",
"md5": "1521ddd9d151fdebcb840f5b87bcc25c",
"sha256": "2ece03633ab8fc7e9aedccc613f5b261b42051ddc8935be0662656868f862048"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp310-cp310-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "1521ddd9d151fdebcb840f5b87bcc25c",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<3.13,>=3.9",
"size": 294532,
"upload_time": "2025-03-14T16:40:16",
"upload_time_iso_8601": "2025-03-14T16:40:16.794028Z",
"url": "https://files.pythonhosted.org/packages/b5/63/9459eacbee363745a05978bfe45440892110e04b8c27f52ddfaca224ff2e/marearts_crystal-1.0.6-cp310-cp310-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c2c98e4ab893b59863108c77def4367bd7b391798f1d2bf7d3e87e5aaf3e9efa",
"md5": "522760f4b3ca21170d410a4f745a1c13",
"sha256": "7e065c865180523b8b2e6a0f2deca85a8280f81290db2ab080c8f126c73bf08e"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "522760f4b3ca21170d410a4f745a1c13",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<3.13,>=3.9",
"size": 48600,
"upload_time": "2025-03-14T16:40:17",
"upload_time_iso_8601": "2025-03-14T16:40:17.829581Z",
"url": "https://files.pythonhosted.org/packages/c2/c9/8e4ab893b59863108c77def4367bd7b391798f1d2bf7d3e87e5aaf3e9efa/marearts_crystal-1.0.6-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4348527cc77b8921d9c3efba415e6895ab3a1adc1b0f020b92df3b8d16480f34",
"md5": "3cecfd048c4b19c837ab601627fde678",
"sha256": "d397731ba36e2e1ee837649f14c708f3de2025ce40abe7ec0dc35a842b5d0405"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp311-cp311-macosx_10_9_universal2.whl",
"has_sig": false,
"md5_digest": "3cecfd048c4b19c837ab601627fde678",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<3.13,>=3.9",
"size": 100313,
"upload_time": "2025-03-14T16:40:19",
"upload_time_iso_8601": "2025-03-14T16:40:19.022109Z",
"url": "https://files.pythonhosted.org/packages/43/48/527cc77b8921d9c3efba415e6895ab3a1adc1b0f020b92df3b8d16480f34/marearts_crystal-1.0.6-cp311-cp311-macosx_10_9_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4ac52b2e624e127374504de4314e6ee6327ee52993d85b6986c41438e8059e50",
"md5": "f0cba55ee7ed7acff29dec689cd83429",
"sha256": "490faedc7b81ad61a710c4a2e481966c37a31208265a27b641b0cb754de19144"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp311-cp311-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "f0cba55ee7ed7acff29dec689cd83429",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<3.13,>=3.9",
"size": 317512,
"upload_time": "2025-03-14T16:40:20",
"upload_time_iso_8601": "2025-03-14T16:40:20.503863Z",
"url": "https://files.pythonhosted.org/packages/4a/c5/2b2e624e127374504de4314e6ee6327ee52993d85b6986c41438e8059e50/marearts_crystal-1.0.6-cp311-cp311-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "585c33678ddfc692ba3d51b7a9aed28c5da8c6044f33c2fcd8348367049d3e02",
"md5": "0dd268d9ba7feabad9ddc113e357c20a",
"sha256": "a7d687cc21ab83a9e6c0ed75e8c695bf7d873c075ba674678c0f1357f687afaf"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "0dd268d9ba7feabad9ddc113e357c20a",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<3.13,>=3.9",
"size": 48838,
"upload_time": "2025-03-14T16:40:21",
"upload_time_iso_8601": "2025-03-14T16:40:21.607415Z",
"url": "https://files.pythonhosted.org/packages/58/5c/33678ddfc692ba3d51b7a9aed28c5da8c6044f33c2fcd8348367049d3e02/marearts_crystal-1.0.6-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "17187e62213e43e6b9f37b85355d19607f14f9cad3693538ffe0609543f9a0ea",
"md5": "3fd398d88123ad7cfeb091904b2eb0be",
"sha256": "9272f6b1145c81dd21ff1c1b3871e03363856cb22caa3974abda46e1342056df"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp312-cp312-macosx_10_13_universal2.whl",
"has_sig": false,
"md5_digest": "3fd398d88123ad7cfeb091904b2eb0be",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": "<3.13,>=3.9",
"size": 101102,
"upload_time": "2025-03-14T16:40:23",
"upload_time_iso_8601": "2025-03-14T16:40:23.001584Z",
"url": "https://files.pythonhosted.org/packages/17/18/7e62213e43e6b9f37b85355d19607f14f9cad3693538ffe0609543f9a0ea/marearts_crystal-1.0.6-cp312-cp312-macosx_10_13_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9075ce90fb8e3b72a5f356169b327765a798178cd804f04707c77c21183f6498",
"md5": "2151908c3a8d3c4ebcbd8860250d6f70",
"sha256": "20d42eb2e61ffe6c29002147e4ea0694e4e1b34a56d7fe31a79a2ba8d28ae9f6"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp312-cp312-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "2151908c3a8d3c4ebcbd8860250d6f70",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": "<3.13,>=3.9",
"size": 308790,
"upload_time": "2025-03-14T16:40:24",
"upload_time_iso_8601": "2025-03-14T16:40:24.496022Z",
"url": "https://files.pythonhosted.org/packages/90/75/ce90fb8e3b72a5f356169b327765a798178cd804f04707c77c21183f6498/marearts_crystal-1.0.6-cp312-cp312-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "58a7a992263f440e057711d165ae47c99ce4eb8de2fa771ec132406f3554602a",
"md5": "79e3697c298de0642f0bfe9d1b851760",
"sha256": "c72ae4effae7d5f53a78628515ea98fc1b61f615ac8cf9691d3ac50ba3767a24"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "79e3697c298de0642f0bfe9d1b851760",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": "<3.13,>=3.9",
"size": 48002,
"upload_time": "2025-03-14T16:40:26",
"upload_time_iso_8601": "2025-03-14T16:40:26.091908Z",
"url": "https://files.pythonhosted.org/packages/58/a7/a992263f440e057711d165ae47c99ce4eb8de2fa771ec132406f3554602a/marearts_crystal-1.0.6-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0040c0254780d5a8b43924de96ec6fec9659e2907fd6a756bb3c597806003c49",
"md5": "13d8422bdaf201d1d946ce8acbc8a960",
"sha256": "7115deedd2cfdc028a9a6134062e1e9f78b7ac276f4d4c6f029f34c408af0d49"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp37-cp37m-manylinux1_x86_64.whl",
"has_sig": false,
"md5_digest": "13d8422bdaf201d1d946ce8acbc8a960",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": "<3.13,>=3.9",
"size": 207064,
"upload_time": "2025-03-14T16:40:27",
"upload_time_iso_8601": "2025-03-14T16:40:27.441103Z",
"url": "https://files.pythonhosted.org/packages/00/40/c0254780d5a8b43924de96ec6fec9659e2907fd6a756bb3c597806003c49/marearts_crystal-1.0.6-cp37-cp37m-manylinux1_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4556008eb9741b5a2360ad7e9b8480c28989f7d940832377eebbd1be886844ae",
"md5": "9c61019c136c36cfa73005ae29293483",
"sha256": "18c7f2fd6f928526647c90f5885cf4c5a3df7fd1c20760e9c517f5fe2187f341"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp37-cp37m-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "9c61019c136c36cfa73005ae29293483",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": "<3.13,>=3.9",
"size": 205906,
"upload_time": "2025-03-14T16:40:29",
"upload_time_iso_8601": "2025-03-14T16:40:29.045999Z",
"url": "https://files.pythonhosted.org/packages/45/56/008eb9741b5a2360ad7e9b8480c28989f7d940832377eebbd1be886844ae/marearts_crystal-1.0.6-cp37-cp37m-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2847e493b160bd67180229ed51c7d9deabc243004bb4f76f89a3cc0ae79cbc24",
"md5": "754e8b1ebd7603c97772f576572bcc58",
"sha256": "b22e0d41f777a8ad452e3d35745b8fd1e2e92b371acaaa17c2c7fd4fd5465583"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp39-cp39-macosx_10_9_universal2.whl",
"has_sig": false,
"md5_digest": "754e8b1ebd7603c97772f576572bcc58",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<3.13,>=3.9",
"size": 101806,
"upload_time": "2025-03-14T16:40:30",
"upload_time_iso_8601": "2025-03-14T16:40:30.296136Z",
"url": "https://files.pythonhosted.org/packages/28/47/e493b160bd67180229ed51c7d9deabc243004bb4f76f89a3cc0ae79cbc24/marearts_crystal-1.0.6-cp39-cp39-macosx_10_9_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4a30466a35489c6aff4d21a630a392fcac808f1ad6dfe45e222d6571d5733952",
"md5": "5ea43841d31eb661522f3a3c59563d87",
"sha256": "01aea7682ca4a910e2bf112364c847d9e93a0687607ebfc20e075541a0cb540d"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp39-cp39-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "5ea43841d31eb661522f3a3c59563d87",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<3.13,>=3.9",
"size": 297357,
"upload_time": "2025-03-14T16:40:31",
"upload_time_iso_8601": "2025-03-14T16:40:31.398983Z",
"url": "https://files.pythonhosted.org/packages/4a/30/466a35489c6aff4d21a630a392fcac808f1ad6dfe45e222d6571d5733952/marearts_crystal-1.0.6-cp39-cp39-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bc5f2f240372f2bdaec761fb2cd5784a847a15694aa895ebf09b3e051689be33",
"md5": "83017ce81a159264dac5bdd98527a831",
"sha256": "b7b17bfdfb0ac825b202aa63b8e10952996d4a37d9143ffcf623a35cc108b1f0"
},
"downloads": -1,
"filename": "marearts_crystal-1.0.6-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "83017ce81a159264dac5bdd98527a831",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<3.13,>=3.9",
"size": 55596,
"upload_time": "2025-03-14T16:40:32",
"upload_time_iso_8601": "2025-03-14T16:40:32.565956Z",
"url": "https://files.pythonhosted.org/packages/bc/5f/2f240372f2bdaec761fb2cd5784a847a15694aa895ebf09b3e051689be33/marearts_crystal-1.0.6-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-14 16:40:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "marearts-crystal",
"github_not_found": true,
"lcname": "marearts-crystal"
}