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.5.0-cp314-cp314-win_arm64.whl (77.9 kB view details)

Uploaded CPython 3.14Windows ARM64

marearts_crystal-2.5.0-cp314-cp314-win_amd64.whl (94.8 kB view details)

Uploaded CPython 3.14Windows x86-64

marearts_crystal-2.5.0-cp314-cp314-manylinux2014_x86_64.whl (823.2 kB view details)

Uploaded CPython 3.14

marearts_crystal-2.5.0-cp314-cp314-manylinux2014_aarch64.whl (817.3 kB view details)

Uploaded CPython 3.14

marearts_crystal-2.5.0-cp314-cp314-macosx_10_15_universal2.whl (214.1 kB view details)

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

marearts_crystal-2.5.0-cp313-cp313-win_arm64.whl (74.4 kB view details)

Uploaded CPython 3.13Windows ARM64

marearts_crystal-2.5.0-cp313-cp313-win_amd64.whl (92.8 kB view details)

Uploaded CPython 3.13Windows x86-64

marearts_crystal-2.5.0-cp313-cp313-manylinux2014_x86_64.whl (832.2 kB view details)

Uploaded CPython 3.13

marearts_crystal-2.5.0-cp313-cp313-manylinux2014_aarch64.whl (817.4 kB view details)

Uploaded CPython 3.13

marearts_crystal-2.5.0-cp313-cp313-macosx_10_13_universal2.whl (213.8 kB view details)

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

marearts_crystal-2.5.0-cp312-cp312-win_arm64.whl (74.6 kB view details)

Uploaded CPython 3.12Windows ARM64

marearts_crystal-2.5.0-cp312-cp312-win_amd64.whl (92.6 kB view details)

Uploaded CPython 3.12Windows x86-64

marearts_crystal-2.5.0-cp312-cp312-manylinux2014_x86_64.whl (834.1 kB view details)

Uploaded CPython 3.12

marearts_crystal-2.5.0-cp312-cp312-manylinux2014_aarch64.whl (816.8 kB view details)

Uploaded CPython 3.12

marearts_crystal-2.5.0-cp312-cp312-macosx_10_13_universal2.whl (215.8 kB view details)

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

marearts_crystal-2.5.0-cp311-cp311-win_arm64.whl (79.9 kB view details)

Uploaded CPython 3.11Windows ARM64

marearts_crystal-2.5.0-cp311-cp311-win_amd64.whl (96.4 kB view details)

Uploaded CPython 3.11Windows x86-64

marearts_crystal-2.5.0-cp311-cp311-manylinux2014_aarch64.whl (870.8 kB view details)

Uploaded CPython 3.11

marearts_crystal-2.5.0-cp311-cp311-manylinux1_x86_64.whl (120.6 kB view details)

Uploaded CPython 3.11

marearts_crystal-2.5.0-cp311-cp311-macosx_10_9_universal2.whl (216.9 kB view details)

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

marearts_crystal-2.5.0-cp310-cp310-win_amd64.whl (95.3 kB view details)

Uploaded CPython 3.10Windows x86-64

marearts_crystal-2.5.0-cp310-cp310-manylinux2014_aarch64.whl (821.2 kB view details)

Uploaded CPython 3.10

marearts_crystal-2.5.0-cp310-cp310-manylinux1_x86_64.whl (729.7 kB view details)

Uploaded CPython 3.10

marearts_crystal-2.5.0-cp310-cp310-macosx_10_9_universal2.whl (218.8 kB view details)

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

File details

Details for the file marearts_crystal-2.5.0-cp314-cp314-win_arm64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp314-cp314-win_arm64.whl
Algorithm Hash digest
SHA256 24d9b5a93393da7af72782698a87d206b590c2a9ea779dd8b6e776646b964304
MD5 d8ed5083ad4860bdcd24fa9f611430bf
BLAKE2b-256 fd0cc1ba9a4dc493aaf2c67c29b7c1cdb395f0f7f6589050e8f34abfb79ac22b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 099630ae1c79687a0648150325388632b08d0418d70fab8676c6769a80ff7fc3
MD5 f67c9fa6e60db84070ce50aa519d5d29
BLAKE2b-256 7b81a95e1e097aa31cb68179a864a38a225a472cc45c27a6efd9ee85b8232caf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3007f6454344ad5dab09a746c737e328be564898f731e4ea8a39d4d23c613592
MD5 892f4b0a96f8981f293fe2fa427c472f
BLAKE2b-256 6530b18301e1c6f13906ab1ba7526086aaa221fa5a32ea0fd4ef046a5992f618

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 32aa7885f637e0270d266dcdef620da129de15f7f0337ac2915593eddf4ee63e
MD5 071697724bbea072b2fa75777a3d7b0e
BLAKE2b-256 b9432d258741266889e3bc25eacbba7fad632512dc1ab78aaee08d7ae52bac76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp314-cp314-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 8d44558b14bbaeb4f2707899c92e557ea4d8d8ed1b9979cebefdfb30a5645e95
MD5 7396781e259b587e086a96ecf31eae5f
BLAKE2b-256 378f581fbd65524360c165cd803f6eda799a4b686bca6a76d306e8598d81812c

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.5.0-cp313-cp313-win_arm64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 37cd972842cbc4cb73fb5fd29a0bdc025099a0cd4f15f9ee0b512843a57f1a51
MD5 9098a29e83173128443071b2170c8277
BLAKE2b-256 fb6045cdc39f4a7ebbd60334822a64ce801c98a650b3d4ddac628e8db90977fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6f86f44952f89008ea15c4b23bdce3bdc1b3c54470421b6d3307b0cc205444d4
MD5 5c776e20cb09b3069d64650f0659c5a1
BLAKE2b-256 6e431defc170205ab35e70eade624e4e62e79b3309bc6c9873032bd8454a4ee2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e7536df8a92234647439ba87d8f4581cfa5c4d1e5ebd7c3e23f96e3993142e49
MD5 1a388e259bd2fc196e3ba1a334fe4f13
BLAKE2b-256 8ef81435a6247cdc4b690593685c95d51f491be4a6bdc7ce542dd3f56ab5f2c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3ec649c4dc93e6cb6e8b8f9cbf647e647bdfc7ddbe93b80a618c4b94d7f93374
MD5 e81e621eb9e17d56ca94ea055d26cb26
BLAKE2b-256 d35308e5ea249863ee861ddaf53c7d2b32ecfdd6ad641947cceae8b4d458a67a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 641d14e836836fc8cc513335bc4c867e1af3e7ab444ce09cde97bfec2805d0f3
MD5 d0674be58d2e7ddaa4a2b6aec4ea5484
BLAKE2b-256 88f0610ce32a530f43717d2396262ebcbd253c30121981cc7f30ede330c4a540

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.5.0-cp312-cp312-win_arm64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp312-cp312-win_arm64.whl
Algorithm Hash digest
SHA256 3742fee3c9c0081d2c9a0dcb900c081510a46165bd71a951f78374ac4d888726
MD5 197fd98b0e06100cd3af5201ca9b5f96
BLAKE2b-256 2291cf5eb2adf3e05d55c05ce5d9dcaa63cb7c5532aa4b9ab30bb6b1341cab65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fcd96e93ab2237ea2db0e0976536faef953d867b4858fdec94fa30c3a56c768b
MD5 d39ef26a9e98d11dbc34bab5af599d5a
BLAKE2b-256 706ee2484ab7ef16c2db6b92c793afe29fa27d86996df7054b5b9ed02efdd4ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40e6d0d5ffb4b1e3ab4cb55d8063d2f3ae000332b627f6e7ff06cf5d9aa77fac
MD5 46dd81fcf79c8386e6759cbe2b9b1e88
BLAKE2b-256 b4fe3542c74354529cfb88e37d237fecd2c5485c9490902e85a896edf5a4e80b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ffac412b214c5e7e024614cfe2703f504accbbe784aaf59a37b322a83893acfb
MD5 ed231407310ea06b9fa677f1ad09c6a7
BLAKE2b-256 3fb3b824619dd338fa7917259e3e4d6a66b3b733626f6fe5e2c66395d26adedc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 a35ad707f8ef57d619d22178edbafb25fdcc9aa198aae9973930bb3d136ef49f
MD5 2fc5c6a764794ecf213106bcdddc839d
BLAKE2b-256 fed53cd6fdd1c61b473e03a07d4e56bf25f422f26de8354223baa52de5cd88f7

See more details on using hashes here.

File details

Details for the file marearts_crystal-2.5.0-cp311-cp311-win_arm64.whl.

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp311-cp311-win_arm64.whl
Algorithm Hash digest
SHA256 1836d762fce81e7cb71b13aac1cc0e6a5f00333399c36d5945ebdae3ab5d3c5c
MD5 8c865221c82cfe84a8707b66bb0878bf
BLAKE2b-256 aa5c67ec3e1ade143e730559b98ae2460a6a73862fb583941eeab5f36070ab58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ec6cb59d72016772abfd1b37c703cf2070bdff012bdf5f4d8adbcfd27f59e7bf
MD5 dcfbabe33e7d1c5dfc0b10afe3b76830
BLAKE2b-256 429f1a252dd211df1b3e46009162a1748ac43371311f83541c35c53cdf53bf56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5a40abbeb35626b8ecfab8252e9a850db8bc8e17215896712d52011be6ac6bbe
MD5 c72526b9e4bd92b7f9f2f90ab9d7c92e
BLAKE2b-256 e51f3dd35cabec79f11b2a3055e194a63ef5bd269a93b159548b44ca43fd95c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 edafac15bb040df0b1771b9c24f38bd804b32693ff37759619994d295db9c51b
MD5 80a6eb90d0d1f5186f20b8f7953aa437
BLAKE2b-256 de19d54edafbae72dfab048c0f2f5bf18272144ca65dc14148a0068d703fc218

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1838b0417b7771ed267e4946359b2efd92e06c2162d9f98044b0d763a1ae7967
MD5 8a967ea9b0c8ccf62a9da843675a04de
BLAKE2b-256 6cc6e1745993db59ceb4fe444b8c571fbb1b720c3e0759bc9330f48cd09c99a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8a0f102163d3c47b2fa3e5e47eacb5333f0873dd088d4d9c5c9a656b0810878a
MD5 2988fe8340302527c31b6c67795143ef
BLAKE2b-256 e8d0cacfdbbfa46c4c17e43042b80712653515e7b6badaefc4bbfdec764658cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c2194cd434d9b02f45ce4ca29b60db1bb4c8ee9cbba0271e4511ae72ed41659c
MD5 9a423168ff1ef94777c08bbccc303f5d
BLAKE2b-256 57a9aa2976783311aeee58aafeed3aa7812cbf696c49496091204c08ba33d91f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c96dffe00e351c4c17e9b331a90c1e5baad35aac0b1951e5caee1276bd33a69c
MD5 295804a71e389ba4d20b04cd53fe1064
BLAKE2b-256 dc1992bbd644e0e3ccf62165ea017f3e83b4299697eaa64465857540f869f30f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_crystal-2.5.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5d86b3fe45d0d1a611f60711a4724ecf1572c71e4bbdfa86d97e33a1d58680c1
MD5 3d9b48233bef8a3ab98f5bfa42617d99
BLAKE2b-256 3bb668eb01fa910441a521a49b6ca5b314c83518170f2f3204a2d14221377d5b

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