Skip to main content

marearts crystal for encryption and decryption

Project description

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:

pip install marearts-crystal

Usage

Here's a comprehensive guide on how to use MareArts Crystal:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

marearts_crystal-1.0.3-cp312-cp312-win_amd64.whl (48.1 kB view details)

Uploaded CPython 3.12 Windows x86-64

marearts_crystal-1.0.3-cp312-cp312-macosx_10_9_universal2.whl (101.1 kB view details)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

marearts_crystal-1.0.3-cp311-cp311-win_amd64.whl (48.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

marearts_crystal-1.0.3-cp311-cp311-macosx_10_9_universal2.whl (100.3 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

marearts_crystal-1.0.3-cp310-cp310-win_amd64.whl (48.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_crystal-1.0.3-cp310-cp310-macosx_10_9_universal2.whl (100.5 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

marearts_crystal-1.0.3-cp39-cp39-win_amd64.whl (55.6 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_crystal-1.0.3-cp39-cp39-macosx_10_9_universal2.whl (101.8 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file marearts_crystal-1.0.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 da3c5d8dee77ee32d5558b6a4dfb0b23531967929857e129999d97bc6e7e9ca9
MD5 e1975d1ea3793aca762092abc5c8e039
BLAKE2b-256 f5142f8d3084a5da4c4f69442a4c2768511a113682625e49268bf9ecadbccf77

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp312-cp312-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9d3426bcad3aa370ca86b8dfe91ed76147860cfd12bd35df62fdecdf2423db1c
MD5 695175f9c3149915a30e060e701d5cdf
BLAKE2b-256 8e0ecbbdd4e9f2c0019cc5ead51635f65a102b86b2ae7d6fcf7da549f2797f4d

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 14dc07bae9badd14843ef28f4ae8b7ed7ba539b4f27891632e125a104c8a897f
MD5 1afb25ade2f7c511e3430857355392be
BLAKE2b-256 39eb987b632add8d73e7764a4be73177bf6b64236f894593751d6f3fa2a8e438

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5427834634f8c471bbdf8b0c9c37fc5b9c205d3d1af3ccf7bba6afc0d5c5bad0
MD5 99f6b79f2e491daed32ba7c0bd9bd29e
BLAKE2b-256 404fe695154380795fe0b898dd41b628f79158bb8ceab612722d5200ec7e31ac

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp311-cp311-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 42aea92382fc194ca9ef9ce144f9ee22d06abe97dad52d28b7efe204ad72316c
MD5 7e8801356ee50c629c9951dac2c97015
BLAKE2b-256 f2d8a5218db086eeaf2e7b981b1415c5c96fb1301e0a64d544e267123b28dbf4

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fcd9c304b2c1fffb07e5294ea7504fc126289b7589a84d489ee02eace0fa2b1e
MD5 afe7f7cfd265a71c688be00878dda71a
BLAKE2b-256 4cd045da7b6aca8dab87d9e1c1a4d3de8786b83c0c30ae7158e15ebae0f88ac1

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1992916c19b2181bb279dc0cc95e6c78c464e4f66ca36be06019f9154ed33ddf
MD5 dfcf140723917c9dcc19d6cdace844b6
BLAKE2b-256 06e6a89f415e4f3bcdcf59a818782c55f47d2eaee1df74dff468ee53ee2c5163

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp310-cp310-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c80a75d2d6312081def2db42c02a7b6939c0e66616e791b718b29f77ebbcf71c
MD5 3c48dcafe8db6a3f20d2fa11527e7ac7
BLAKE2b-256 4062dc5f131eba8e4f5e21ecca475650dd76041cf9ba7adf44a3da253e454d97

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 acb655de4285323d76e3dc52f88fa609276411cd16005552d49f54e036d0fda0
MD5 fd5785550c69d90af3d20802e5257598
BLAKE2b-256 862829e963cebf661be162e4ee5bb79c360121a4ccdbff5ce61c25654844557b

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b8463a4a210eb228a8e339ffcb20daf7186ba75a948c04882ceb1c9cc3f77aec
MD5 2c903fc2c745e855db73bf88939547ba
BLAKE2b-256 18c2537a2842ad5afe8fff6e34472f6ebc3af439bb4cba885565818521aed7cf

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp39-cp39-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 776189bf2e8a73354c19b2180807decf93490d29398192b0bf4ddd17c72ab7bb
MD5 20a405719e24bc188d8bbc385065b528
BLAKE2b-256 511242510740ae9ec0ce9b3b084139de9837de430ee6069d7c8e40233e58954c

See more details on using hashes here.

File details

Details for the file marearts_crystal-1.0.3-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for marearts_crystal-1.0.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4f9808678f343bc95d4176ad98b3217ff070157c6ffe5779ccd8c90bb085425c
MD5 927b7696611fe6774e5fb98080de9f95
BLAKE2b-256 fc96f6f25686328e20a0bfc307f292aa36454088ee57f5472a076a5a66088f6e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page