Skip to main content

marearts crystal for encryption and decryption

Project description

MareArts Crystal

PyPI Python versions Downloads License

Python encryption library for software licensing and data protection. Simple, fast, and cross-platform.

🎯 Core Features

  • Software Licensing - Generate and validate time-limited license keys with signatures
  • File Encryption - Protect any file type with filename-based encryption
  • Data Security - Encrypt strings, configs, and binary data with one line of code

💡 Why MareArts Crystal?

  • Simple - Just pip install marearts-crystal and start coding
  • Fast - Cython-compiled for C++ performance
  • Compatible - Python 3.9-3.14, Windows/macOS/Linux
  • Proven - Used in production by real businesses

Installation

pip install marearts-crystal

Requirements: Python 3.9-3.14, Windows/macOS/Linux

Quick Start

License Key Generation

from marearts_crystal import ma_crystal

mask = ma_crystal("your-company-secret")

# Generate license key with signature
today = mask.get_today_date()  # "2025-09-12"
expire = mask.generate_end_date(years=1)  # "2026-09-12"
license_key, signature = mask.generate_serial_key("customer@email.com", today, expire)

print(f"License Key: {license_key}")
# Output: License Key: MAEV2:gAAAAABow91CXuG7dJR3eAWpEXj67RP-qboPAHiDGpVfd2dGN5yBXp...

print(f"Signature: {signature}")
# Output: Signature: a21521da5beb6d7c

# Validate license
result = mask.validate_serial_key("customer@email.com", license_key)
if result:
    start_date, end_date, signature = result
    # start_date = "2025-09-12", end_date = "2026-09-12", signature = "a21521da5beb6d7c"
    if mask.validate_date(start_date, end_date):
        print(f"✅ License active until {end_date}")
        # Output: ✅ License active until 2026-09-12
# Using signature for tracking
license_db = {}  # Your database

# Store license with signature
license_key, signature = mask.generate_serial_key("user@email.com", today, expire)
license_db[signature] = {
    "email": "user@email.com",
    "key": license_key,
    "created": today
}

# Later, verify and track
result = mask.validate_serial_key("user@email.com", license_key)
if result:
    start, end, sig = result
    print(f"License {sig} is valid")  # Use signature as ID

File Encryption

# Encrypt file
with open("document.pdf", "rb") as f:
    file_data = f.read()  # Read original file (e.g., 241979 bytes)

encrypted = mask.encrypt_data(file_data)
print(f"Encrypted size: {len(encrypted)} bytes")
# Output: Encrypted size: 322724 bytes

with open("document.pdf.enc", "wb") as f:
    f.write(encrypted)

# Decrypt file
with open("document.pdf.enc", "rb") as f:
    encrypted_data = f.read()

decrypted = mask.decrypt_data(encrypted_data)
print(f"Decrypted size: {len(decrypted)} bytes")
# Output: Decrypted size: 241979 bytes (matches original)

with open("document_decrypted.pdf", "wb") as f:
    f.write(decrypted)
print("✅ File successfully decrypted")
# Output: ✅ File successfully decrypted

More Examples

Python Examples (View on GitHub)

  • License key generation and validation
  • File encryption/decryption
  • Config file encryption
  • License manager class implementation
  • Password vault implementation
  • All API methods demonstration

Jupyter Notebook (Interactive Tutorial)

  • Interactive step-by-step tutorial
  • Visual output of each operation
  • Real-time testing environment

API Reference

Basic Methods

Method Description Example
generate_serial_key(username, start_date, end_date) Generate a license key with signature key, signature = mask.generate_serial_key("user", "2025-09-10", "2025-12-31")
validate_serial_key(username, serial_key) Validate a license key result = mask.validate_serial_key("user", key) # Returns (start_date, end_date, signature)
encrypt_string(text) Encrypt text encrypted = mask.encrypt_string("secret")
decrypt_string(encrypted) Decrypt text text = mask.decrypt_string(encrypted)
encrypt_data(bytes) Encrypt binary data encrypted = mask.encrypt_data(b"data")
decrypt_data(encrypted) Decrypt binary data data = mask.decrypt_data(encrypted)

Utility Methods

Method Description Example
get_today_date() Get today's date (YYYY-MM-DD) today = mask.get_today_date()
generate_end_date(years, months, days) Calculate future date expire = mask.generate_end_date(years=1)
validate_date(start, end) Check if current date is in range valid = mask.validate_date("2025-09-10", "2025-12-31")
is_v2_serial_key(key) Check if key uses V2 format is_v2 = mask.is_v2_serial_key(key)
is_v2_data(data) Check if data uses V2 encryption is_v2 = mask.is_v2_data(data)
string_to_secret_key(input_string) Derive key from string key = mask.string_to_secret_key("password")
secret_key_to_string(secret_key, encrypted) Decrypt with provided key text = mask.secret_key_to_string(key, encrypted)

Maintainer CI/CD Layout

Root folder keeps only 3 main CI scripts:

  • ./building_wheels.sh - build local Linux wheels
  • ./publish_wheels.sh - upload local artifacts to PyPI
  • ./trigger_github_action.sh - push release tag to trigger GitHub Actions (macOS/Windows wheels)

All helper scripts are under scripts/:

  • scripts/pipeline/ - orchestrators and pipeline entry scripts
  • scripts/build/linux/ - per-Python/per-arch Linux wheel builders
  • scripts/verify/ - wheel and PyPI verification scripts
  • scripts/helpers/ - utility scripts (version sync, helpers)
  • scripts/legacy/ - deprecated scripts kept for reference

Example maintainer flow:

./building_wheels.sh
./publish_wheels.sh
./trigger_github_action.sh

Optional helper commands:

./scripts/verify/verify_wheels_docker.sh
./scripts/verify/verify_pypi_install.sh
./scripts/helpers/update_version.sh
./scripts/pipeline/build_all_wheels.sh

🔗 MareArts AI Package Family

MareArts Crystal is part of our comprehensive AI and utility package ecosystem:

Package Description Use Case
marearts-anpr 🚗 License Plate Recognition Vehicle identification, parking systems, traffic monitoring
marearts-road-objects 🛣️ Road Object Detection Traffic analysis, smart city applications, safety systems
marearts-crystal 🔐 Encryption & Licensing Software licensing, data security, key management
marearts-xcolor 🎨 High-performance color extraction Color detection apps, dominant color query systems

Support

License

MIT License

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

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

marearts_crystal-2.4.3-cp314-cp314-win_amd64.whl (83.5 kB view details)

Uploaded CPython 3.14Windows x86-64

marearts_crystal-2.4.3-cp314-cp314-manylinux2014_x86_64.whl (617.9 kB view details)

Uploaded CPython 3.14

marearts_crystal-2.4.3-cp314-cp314-manylinux2014_aarch64.whl (610.9 kB view details)

Uploaded CPython 3.14

marearts_crystal-2.4.3-cp314-cp314-macosx_10_15_universal2.whl (185.4 kB view details)

Uploaded CPython 3.14macOS 10.15+ universal2 (ARM64, x86-64)

marearts_crystal-2.4.3-cp313-cp313-win_amd64.whl (83.1 kB view details)

Uploaded CPython 3.13Windows x86-64

marearts_crystal-2.4.3-cp313-cp313-manylinux2014_x86_64.whl (626.7 kB view details)

Uploaded CPython 3.13

marearts_crystal-2.4.3-cp313-cp313-manylinux2014_aarch64.whl (611.0 kB view details)

Uploaded CPython 3.13

marearts_crystal-2.4.3-cp313-cp313-macosx_10_13_universal2.whl (184.9 kB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

marearts_crystal-2.4.3-cp312-cp312-win_amd64.whl (82.7 kB view details)

Uploaded CPython 3.12Windows x86-64

marearts_crystal-2.4.3-cp312-cp312-manylinux2014_x86_64.whl (629.5 kB view details)

Uploaded CPython 3.12

marearts_crystal-2.4.3-cp312-cp312-manylinux2014_aarch64.whl (614.0 kB view details)

Uploaded CPython 3.12

marearts_crystal-2.4.3-cp312-cp312-macosx_10_13_universal2.whl (186.4 kB view details)

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

marearts_crystal-2.4.3-cp311-cp311-win_amd64.whl (84.7 kB view details)

Uploaded CPython 3.11Windows x86-64

marearts_crystal-2.4.3-cp311-cp311-manylinux2014_aarch64.whl (662.6 kB view details)

Uploaded CPython 3.11

marearts_crystal-2.4.3-cp311-cp311-manylinux1_x86_64.whl (565.7 kB view details)

Uploaded CPython 3.11

marearts_crystal-2.4.3-cp311-cp311-macosx_10_9_universal2.whl (188.7 kB view details)

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

marearts_crystal-2.4.3-cp310-cp310-win_amd64.whl (84.0 kB view details)

Uploaded CPython 3.10Windows x86-64

marearts_crystal-2.4.3-cp310-cp310-manylinux2014_aarch64.whl (616.1 kB view details)

Uploaded CPython 3.10

marearts_crystal-2.4.3-cp310-cp310-manylinux1_x86_64.whl (535.9 kB view details)

Uploaded CPython 3.10

marearts_crystal-2.4.3-cp310-cp310-macosx_10_9_universal2.whl (190.3 kB view details)

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

marearts_crystal-2.4.3-cp39-cp39-win_amd64.whl (95.2 kB view details)

Uploaded CPython 3.9Windows x86-64

marearts_crystal-2.4.3-cp39-cp39-manylinux2014_aarch64.whl (613.6 kB view details)

Uploaded CPython 3.9

marearts_crystal-2.4.3-cp39-cp39-manylinux1_x86_64.whl (534.8 kB view details)

Uploaded CPython 3.9

marearts_crystal-2.4.3-cp39-cp39-macosx_10_9_universal2.whl (191.3 kB view details)

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

File details

Details for the file marearts_crystal-2.4.3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 ad2f76b2efdab82e97f2235389f381c2b262df4026517a9e2bfe16bace36d6f1
MD5 309ae0a3d3a2d9d755d3eebee95d2726
BLAKE2b-256 656e255038168c7776ccd3763f1ff2e609ba78c32492e0cb3a5c374649336479

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp314-cp314-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a825f2f472f8c47a290488c2a6357b9618ff9be7801461f672cc3d5259f3ea8a
MD5 d30136b85bfa6c1138e1924c8ea5f58c
BLAKE2b-256 51d84e05c6c6440c5548b726ee242e98ba1229045f773b9abeaa873f16f8bfef

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp314-cp314-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 56e9414c4cce8640c850da3f0ea6e2542510c2456df072c4741e8d5cae5ff925
MD5 b95b76a30fb5348db6403e66903204f1
BLAKE2b-256 294d3d58f9b84c463550b10480357c72130209eb7dfecd6620ede1cf8ff2cd7d

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp314-cp314-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp314-cp314-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 825af0543078ef6b7752a8215423637d4bfe8fb6e5619ace43c78972be8ae54c
MD5 92ca68e791f28090d0d637fabfa00406
BLAKE2b-256 12765697b9f355815aaaf33df7c5732afaba2bc5e32a7d67b9a0c984fe59c825

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0678a9c91e7ea7e6ff05c571fcc73bd626d52f29a5d556cb0febea74e2a5889b
MD5 0d3d825dd98bb526e886a0eb4a8b7674
BLAKE2b-256 13f5ef6b3e34637624d6a0cb9179318c644d0025e6011c41003f46b80ad229b0

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d26fe62a46fe5647bccec40673b2b7d19cf24f4c9b4bb65a35cfe48f37b8c4f4
MD5 9cff03308eb371a242ae30312b5e88f4
BLAKE2b-256 5da8998997f780405f667e0b7256d7a164abc70e9bc46d8bd5f83995b9007161

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp313-cp313-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e9293b59832369dcb69b26c1337595c86dda0405bc1a2cbe76ca86e9c6f8b24b
MD5 d43c122cd0afbdb528375b3e8bb4218c
BLAKE2b-256 093883c4a334aed6adc79514287623ae85b5737c798a50c5996c89bca36cab83

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 dcac4eca451a00e99470b3f82f7ffed07fd628c9519237ebd9c190f428da70fa
MD5 a08a9f77bba9a03621c2ce7cb71eb1ad
BLAKE2b-256 4cbf79a31c8b316276214e3adc5dccc4feab27b0acaac9207d6176121eeaa6cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 259923e8bc3404ea89456b6a84db3b3dbab0c6deb08559ef0db3b71cc6d866a9
MD5 addd501af976027cdd316439fed48997
BLAKE2b-256 00d58f7c1128d11d99052c69f61cf7ae3526720cb19210cd5ec7c8ae4f83c57b

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e2d72d8c75a60916901771465d6615ad39a79275b4d1aa0d52832805def3721
MD5 734a7badeda5797463b05d59232ce19c
BLAKE2b-256 2ed512cfaa7accfb2fdcf025265586477bb8ecf4be6117e1618f68805e37ed60

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7b738fa39650b8122af5c33552e6a925ccec07cfbeb012306b1b50bdbce9ec7b
MD5 2e510fa52c989ef9b10bf520e6275025
BLAKE2b-256 bed2dfec7a966aedf9dae890554fcd5355ac550e9263ce0611ad9e8ef83af055

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 505d68b63d5c33a2f11fbaafbdb7f30c281f463168b9114c696ad6fa89804921
MD5 0344aacebf0a9b46d85503e37585f690
BLAKE2b-256 b289c8b1cd9e431eacc3d2870ef47beccb257dc7b5647b7c14964cdb6db228b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 081b254216eb44cce80ca51779dec11af311f28bef3625791f41801b28cf0aa2
MD5 28b524ade3098f3cbdea1daaaf2482a2
BLAKE2b-256 64f52b3e0fb2468ff95174dc78fde50a02161de966139e334b8c3fdac8c62791

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b12e46591392bce77236d98df6bb1560354cf37c50dcf5dc7c9cb7cada3418e7
MD5 a7586e8ce08ef98de65cc99ac0d31d35
BLAKE2b-256 d58bf9553d4a8d737f93a8b7089644a2546852728c22ccc367fcd916d12c64fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1d44a9e9626ed8b301b313e447c285844c511391b72e429574e2fdb4d7babf08
MD5 f241cbda915a9a40c84d982321a5afb7
BLAKE2b-256 5a95b8504f8534fa2bd231e56820111a9c7ae5f4caa95cda65e2b616d9c45b89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7c1c9d44f28ca82c725703f9ff49db245779b220a389a09da213bf4cb8de0acd
MD5 8688595817c6db8fbb7720ff58292709
BLAKE2b-256 69e6e0e4909f5b7c25df4d4df5d39ffaafcf5fc3bc248a3a0c0a42b83a9519a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0e4edf4db5a9e8375857bd706cabe2db8da8fa0ec3e6e4ec262b226a75505828
MD5 d37c21ae5d256958d0f917d70fa188c2
BLAKE2b-256 08be4a30b1f85095613639de90834d4be73a54351f0ad20e98ad53d31c1601be

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 23e4ad38fd9d6d0b8775f0ac4c13204f8a69ce6c69f742d772971bf63a6daaed
MD5 36788891ca8b3050a98ab668efb257d5
BLAKE2b-256 a65240ad0831ef2cb721337a5b8a7b87c400899ef519045cb72c26ced6c2210f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 547b75fc62107a49ca01855b9e7d8ebff930405e999319ece73efb89f8dc8084
MD5 786e225a137de68bb769af1361c5e485
BLAKE2b-256 655dd618d86d0b129c0af5047d4c8aee69030d413d3ab73a2423057fe9e8b681

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8de647eedf7882515a5b36674e1132fdf5d88db1ad42e8024a00e7159ee7b400
MD5 96b352844b13dccbf24d1ee9b88b2cb6
BLAKE2b-256 e9485c2377792772d01f6f0dd1b12451169cffe4d0e9e534e2c34388708a0ef5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8e4da9eb520d04dd3107d0c08807f282669f0ad6a8da82add96c820389987f62
MD5 b30c3bd843fdd9f033a31f6c9abfd955
BLAKE2b-256 f7e341874caba51f19062b6b7ce409ee05d13a7b69e338a244ec6bec5ffe7f82

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.4.3-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a6a66c2d8989524f8ea2341aa66617de82fa76f8874e31db53fc9c5ac253a230
MD5 54114d03c52e42503d51d24b1a3cfe16
BLAKE2b-256 efee4cabf89e1522ce21b61b78c9abb7d2d3dd0af56cd1e9354ac50fec4a9aee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c3dec2425e2143568c1d2049302375d98a977834f5eba430f8f38864ca9a2f7e
MD5 4713c862324d0bac44adee89e5131ac5
BLAKE2b-256 f431002d616637bd35f42e54a812c8dd5845a733c6b3af42af66dd074a32a8f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.4.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6aa0464088562938d0e6dfdb0b0274ce4ec733ba68e47e08d65aaaca623c14a9
MD5 f115d6071940280276ce7e796e185ee5
BLAKE2b-256 662f20f7bbda8c647bd1350b8b26241ab63c3114feb7c1939dd1775488891d47

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