marearts-crystal 1.0.6__cp37-cp37m-manylinux2014_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ from .ma_crystal import ma_crystal
File without changes
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.1
2
+ Name: marearts-crystal
3
+ Version: 1.0.6
4
+ Summary: marearts crystal for encryption and decryption
5
+ Home-page: https://www.marearts.com
6
+ Author: MareArts
7
+ Author-email: hello@marearts.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: <3.13,>=3.9
17
+ Description-Content-Type: text/markdown
18
+ Requires-Dist: cffi ==1.16.0
19
+ Requires-Dist: cryptography ==43.0.0
20
+ Requires-Dist: pycparser ==2.22
21
+
22
+ # MareArts Crystal
23
+
24
+ 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.
25
+
26
+ ## Installation
27
+
28
+ Install MareArts Crystal using pip:
29
+
30
+ ```bash
31
+ pip install marearts-crystal
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ Here's a comprehensive guide on how to use MareArts Crystal:
37
+
38
+ ```python
39
+ from marearts_crystal import ma_crystal
40
+
41
+ # Initialize with a secret key
42
+ secret_key = "your_secret_key_here"
43
+ skm = ma_crystal(secret_key)
44
+
45
+ # Generate a serial key
46
+ username = "john_doe"
47
+ start_date = "2023-07-01"
48
+ end_date = "2023-12-31"
49
+ serial_key = skm.generate_serial_key(username, start_date, end_date)
50
+ print(f"Generated Serial Key: {serial_key}")
51
+
52
+ # Validate the serial key
53
+ validated_start, validated_end = skm.validate_serial_key(username, serial_key)
54
+ print(f"Validated Start Date: {validated_start}")
55
+ print(f"Validated End Date: {validated_end}")
56
+
57
+ # Date validation
58
+ if skm.validate_date("2024-07-01", "2024-12-31"):
59
+ print("Date range is valid")
60
+ else:
61
+ print("Date range is invalid")
62
+
63
+ # Get today's date
64
+ print("Today's date:", skm.get_today_date())
65
+
66
+ # Generate end dates
67
+ print("Tomorrow:", skm.generate_end_date(0, 0, 1))
68
+ print("Next month:", skm.generate_end_date(0, 1, 0))
69
+ print("Next year:", skm.generate_end_date(1, 0, 0))
70
+
71
+ # Try with an invalid key
72
+ invalid_result = skm.validate_serial_key(username, "invalid_key")
73
+ print(f"Invalid Key Result: {invalid_result}")
74
+
75
+ invalid_result = skm.validate_serial_key("wrong_name", serial_key)
76
+ print(f"Invalid Key Result: {invalid_result}")
77
+
78
+ # String encryption and decryption
79
+ original_string = "Hello, MareArts Crystal!"
80
+ encrypted = skm.encrypt_string(original_string)
81
+ print(f"Encrypted: {encrypted}")
82
+
83
+ decrypted = skm.decrypt_string(encrypted)
84
+ print(f"Decrypted: {decrypted}")
85
+
86
+ # Decryption with wrong key
87
+ wrong_key = "wrong_secret_key"
88
+ wrong_skm = ma_crystal(wrong_key)
89
+ wrong_decryption = wrong_skm.decrypt_string(encrypted)
90
+ print(f"Decryption with wrong key: {wrong_decryption}")
91
+
92
+ # File encryption and decryption
93
+ input_filename = "example.bin" # This can be any file, binary or text
94
+ output_encrypted_filename = "example_encrypted.bin"
95
+
96
+ # Read and encrypt the file
97
+ with open(input_filename, "rb") as file:
98
+ file_content = file.read()
99
+ encrypted_content = skm.encrypt_data(file_content)
100
+
101
+ # Save the encrypted content
102
+ with open(output_encrypted_filename, "wb") as file:
103
+ file.write(encrypted_content)
104
+ print(f"File '{input_filename}' has been encrypted and saved as '{output_encrypted_filename}'")
105
+
106
+ # Decrypt the file
107
+ input_encrypted_filename = output_encrypted_filename
108
+ output_decrypted_filename = "example_decrypted.bin"
109
+
110
+ # Read and decrypt the file
111
+ with open(input_encrypted_filename, "rb") as file:
112
+ encrypted_content = file.read()
113
+ decrypted_content = skm.decrypt_data(encrypted_content)
114
+
115
+ if decrypted_content:
116
+ # Save the decrypted content
117
+ with open(output_decrypted_filename, "wb") as file:
118
+ file.write(decrypted_content)
119
+ print(f"File '{input_encrypted_filename}' has been decrypted and saved as '{output_decrypted_filename}'")
120
+ else:
121
+ print("Decryption failed. The file might be corrupted or the wrong key was used.")
122
+ ```
123
+
124
+ ## Features
125
+
126
+ - Serial key generation and validation
127
+ - Date validation and manipulation
128
+ - String encryption and decryption
129
+ - File encryption and decryption
130
+ - Secure key management
131
+
132
+ ## License
133
+
134
+ This project is licensed under the MIT License
135
+
136
+
137
+ ## Support
138
+
139
+ www.marearts.com
140
+
@@ -0,0 +1,7 @@
1
+ marearts_crystal/__init__.py,sha256=VtyfnD_IJ_ZeQ0RSpcUBRpqblBIIER_-SrEsAJyoMfU,34
2
+ marearts_crystal/ma_crystal.cpython-37m-aarch64-linux-gnu.so,sha256=JWnRZwDgJJXzFXwA-e3CY42WLCaBXiyrlcuoIRGci24,668704
3
+ marearts_crystal-1.0.6.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ marearts_crystal-1.0.6.dist-info/METADATA,sha256=Q0en3SA1Z8MheS7qVUfv4m-XzfELBZBT0Ip9fWfaWYE,4235
5
+ marearts_crystal-1.0.6.dist-info/WHEEL,sha256=W3YQIIvsMisoAiZVCvEplcFp1Df-_7Cf4uChYQwZtf0,105
6
+ marearts_crystal-1.0.6.dist-info/top_level.txt,sha256=N9PKpzxPIIZdhvSjlhuEl1yqenIsFaCE2HIs77WPdHI,17
7
+ marearts_crystal-1.0.6.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.42.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp37-cp37m-linux_aarch64
5
+
@@ -0,0 +1 @@
1
+ marearts_crystal