marearts-crystal


Namemarearts-crystal JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://www.marearts.com
Summarymarearts crystal for encryption and decryption
upload_time2024-08-05 21:25:56
maintainerNone
docs_urlNone
authorMareArts
requires_python<3.13,>=3.9
licenseNone
keywords encryption decryption cython
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.3",
    "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": "",
            "digests": {
                "blake2b_256": "862829e963cebf661be162e4ee5bb79c360121a4ccdbff5ce61c25654844557b",
                "md5": "fd5785550c69d90af3d20802e5257598",
                "sha256": "acb655de4285323d76e3dc52f88fa609276411cd16005552d49f54e036d0fda0"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp310-cp310-macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "fd5785550c69d90af3d20802e5257598",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": "<3.13,>=3.9",
            "size": 100498,
            "upload_time": "2024-08-05T21:25:56",
            "upload_time_iso_8601": "2024-08-05T21:25:56.240393Z",
            "url": "https://files.pythonhosted.org/packages/86/28/29e963cebf661be162e4ee5bb79c360121a4ccdbff5ce61c25654844557b/marearts_crystal-1.0.3-cp310-cp310-macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4062dc5f131eba8e4f5e21ecca475650dd76041cf9ba7adf44a3da253e454d97",
                "md5": "3c48dcafe8db6a3f20d2fa11527e7ac7",
                "sha256": "c80a75d2d6312081def2db42c02a7b6939c0e66616e791b718b29f77ebbcf71c"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp310-cp310-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "3c48dcafe8db6a3f20d2fa11527e7ac7",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": "<3.13,>=3.9",
            "size": 305298,
            "upload_time": "2024-08-05T21:25:57",
            "upload_time_iso_8601": "2024-08-05T21:25:57.444679Z",
            "url": "https://files.pythonhosted.org/packages/40/62/dc5f131eba8e4f5e21ecca475650dd76041cf9ba7adf44a3da253e454d97/marearts_crystal-1.0.3-cp310-cp310-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06e6a89f415e4f3bcdcf59a818782c55f47d2eaee1df74dff468ee53ee2c5163",
                "md5": "dfcf140723917c9dcc19d6cdace844b6",
                "sha256": "1992916c19b2181bb279dc0cc95e6c78c464e4f66ca36be06019f9154ed33ddf"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "dfcf140723917c9dcc19d6cdace844b6",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": "<3.13,>=3.9",
            "size": 48633,
            "upload_time": "2024-08-05T21:25:59",
            "upload_time_iso_8601": "2024-08-05T21:25:59.460145Z",
            "url": "https://files.pythonhosted.org/packages/06/e6/a89f415e4f3bcdcf59a818782c55f47d2eaee1df74dff468ee53ee2c5163/marearts_crystal-1.0.3-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4cd045da7b6aca8dab87d9e1c1a4d3de8786b83c0c30ae7158e15ebae0f88ac1",
                "md5": "afe7f7cfd265a71c688be00878dda71a",
                "sha256": "fcd9c304b2c1fffb07e5294ea7504fc126289b7589a84d489ee02eace0fa2b1e"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp311-cp311-macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "afe7f7cfd265a71c688be00878dda71a",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": "<3.13,>=3.9",
            "size": 100313,
            "upload_time": "2024-08-05T21:26:00",
            "upload_time_iso_8601": "2024-08-05T21:26:00.429993Z",
            "url": "https://files.pythonhosted.org/packages/4c/d0/45da7b6aca8dab87d9e1c1a4d3de8786b83c0c30ae7158e15ebae0f88ac1/marearts_crystal-1.0.3-cp311-cp311-macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2d8a5218db086eeaf2e7b981b1415c5c96fb1301e0a64d544e267123b28dbf4",
                "md5": "7e8801356ee50c629c9951dac2c97015",
                "sha256": "42aea92382fc194ca9ef9ce144f9ee22d06abe97dad52d28b7efe204ad72316c"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp311-cp311-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "7e8801356ee50c629c9951dac2c97015",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": "<3.13,>=3.9",
            "size": 325075,
            "upload_time": "2024-08-05T21:26:03",
            "upload_time_iso_8601": "2024-08-05T21:26:03.705426Z",
            "url": "https://files.pythonhosted.org/packages/f2/d8/a5218db086eeaf2e7b981b1415c5c96fb1301e0a64d544e267123b28dbf4/marearts_crystal-1.0.3-cp311-cp311-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "404fe695154380795fe0b898dd41b628f79158bb8ceab612722d5200ec7e31ac",
                "md5": "99f6b79f2e491daed32ba7c0bd9bd29e",
                "sha256": "5427834634f8c471bbdf8b0c9c37fc5b9c205d3d1af3ccf7bba6afc0d5c5bad0"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "99f6b79f2e491daed32ba7c0bd9bd29e",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": "<3.13,>=3.9",
            "size": 48853,
            "upload_time": "2024-08-05T21:26:04",
            "upload_time_iso_8601": "2024-08-05T21:26:04.793412Z",
            "url": "https://files.pythonhosted.org/packages/40/4f/e695154380795fe0b898dd41b628f79158bb8ceab612722d5200ec7e31ac/marearts_crystal-1.0.3-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39eb987b632add8d73e7764a4be73177bf6b64236f894593751d6f3fa2a8e438",
                "md5": "1afb25ade2f7c511e3430857355392be",
                "sha256": "14dc07bae9badd14843ef28f4ae8b7ed7ba539b4f27891632e125a104c8a897f"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp312-cp312-macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "1afb25ade2f7c511e3430857355392be",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": "<3.13,>=3.9",
            "size": 101084,
            "upload_time": "2024-08-05T21:26:05",
            "upload_time_iso_8601": "2024-08-05T21:26:05.694772Z",
            "url": "https://files.pythonhosted.org/packages/39/eb/987b632add8d73e7764a4be73177bf6b64236f894593751d6f3fa2a8e438/marearts_crystal-1.0.3-cp312-cp312-macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e0ecbbdd4e9f2c0019cc5ead51635f65a102b86b2ae7d6fcf7da549f2797f4d",
                "md5": "695175f9c3149915a30e060e701d5cdf",
                "sha256": "9d3426bcad3aa370ca86b8dfe91ed76147860cfd12bd35df62fdecdf2423db1c"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp312-cp312-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "695175f9c3149915a30e060e701d5cdf",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": "<3.13,>=3.9",
            "size": 311844,
            "upload_time": "2024-08-05T21:26:07",
            "upload_time_iso_8601": "2024-08-05T21:26:07.074362Z",
            "url": "https://files.pythonhosted.org/packages/8e/0e/cbbdd4e9f2c0019cc5ead51635f65a102b86b2ae7d6fcf7da549f2797f4d/marearts_crystal-1.0.3-cp312-cp312-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5142f8d3084a5da4c4f69442a4c2768511a113682625e49268bf9ecadbccf77",
                "md5": "e1975d1ea3793aca762092abc5c8e039",
                "sha256": "da3c5d8dee77ee32d5558b6a4dfb0b23531967929857e129999d97bc6e7e9ca9"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp312-cp312-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "e1975d1ea3793aca762092abc5c8e039",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": "<3.13,>=3.9",
            "size": 48051,
            "upload_time": "2024-08-05T21:26:08",
            "upload_time_iso_8601": "2024-08-05T21:26:08.611741Z",
            "url": "https://files.pythonhosted.org/packages/f5/14/2f8d3084a5da4c4f69442a4c2768511a113682625e49268bf9ecadbccf77/marearts_crystal-1.0.3-cp312-cp312-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fc96f6f25686328e20a0bfc307f292aa36454088ee57f5472a076a5a66088f6e",
                "md5": "927b7696611fe6774e5fb98080de9f95",
                "sha256": "4f9808678f343bc95d4176ad98b3217ff070157c6ffe5779ccd8c90bb085425c"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp39-cp39-macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "927b7696611fe6774e5fb98080de9f95",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": "<3.13,>=3.9",
            "size": 101803,
            "upload_time": "2024-08-05T21:26:09",
            "upload_time_iso_8601": "2024-08-05T21:26:09.909055Z",
            "url": "https://files.pythonhosted.org/packages/fc/96/f6f25686328e20a0bfc307f292aa36454088ee57f5472a076a5a66088f6e/marearts_crystal-1.0.3-cp39-cp39-macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "511242510740ae9ec0ce9b3b084139de9837de430ee6069d7c8e40233e58954c",
                "md5": "20a405719e24bc188d8bbc385065b528",
                "sha256": "776189bf2e8a73354c19b2180807decf93490d29398192b0bf4ddd17c72ab7bb"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp39-cp39-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "20a405719e24bc188d8bbc385065b528",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": "<3.13,>=3.9",
            "size": 308380,
            "upload_time": "2024-08-05T21:26:10",
            "upload_time_iso_8601": "2024-08-05T21:26:10.942043Z",
            "url": "https://files.pythonhosted.org/packages/51/12/42510740ae9ec0ce9b3b084139de9837de430ee6069d7c8e40233e58954c/marearts_crystal-1.0.3-cp39-cp39-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18c2537a2842ad5afe8fff6e34472f6ebc3af439bb4cba885565818521aed7cf",
                "md5": "2c903fc2c745e855db73bf88939547ba",
                "sha256": "b8463a4a210eb228a8e339ffcb20daf7186ba75a948c04882ceb1c9cc3f77aec"
            },
            "downloads": -1,
            "filename": "marearts_crystal-1.0.3-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "2c903fc2c745e855db73bf88939547ba",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": "<3.13,>=3.9",
            "size": 55573,
            "upload_time": "2024-08-05T21:26:12",
            "upload_time_iso_8601": "2024-08-05T21:26:12.646744Z",
            "url": "https://files.pythonhosted.org/packages/18/c2/537a2842ad5afe8fff6e34472f6ebc3af439bb4cba885565818521aed7cf/marearts_crystal-1.0.3-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-05 21:25:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "marearts-crystal",
    "github_not_found": true,
    "lcname": "marearts-crystal"
}
        
Elapsed time: 0.93792s