marearts-crystal 1.0.3__cp39-cp39-win_amd64.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.
- marearts_crystal/__init__.py +1 -0
- marearts_crystal/ma_crystal.cp39-win_amd64.pyd +0 -0
- marearts_crystal-1.0.3.dist-info/LICENSE +0 -0
- marearts_crystal-1.0.3.dist-info/METADATA +141 -0
- marearts_crystal-1.0.3.dist-info/RECORD +7 -0
- marearts_crystal-1.0.3.dist-info/WHEEL +5 -0
- marearts_crystal-1.0.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1 @@
|
|
1
|
+
from .ma_crystal import ma_crystal
|
Binary file
|
File without changes
|
@@ -0,0 +1,141 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: marearts-crystal
|
3
|
+
Version: 1.0.3
|
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
|
+
License-File: LICENSE
|
19
|
+
Requires-Dist: cffi==1.16.0
|
20
|
+
Requires-Dist: cryptography==43.0.0
|
21
|
+
Requires-Dist: pycparser==2.22
|
22
|
+
|
23
|
+
# MareArts Crystal
|
24
|
+
|
25
|
+
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.
|
26
|
+
|
27
|
+
## Installation
|
28
|
+
|
29
|
+
Install MareArts Crystal using pip:
|
30
|
+
|
31
|
+
```bash
|
32
|
+
pip install marearts-crystal
|
33
|
+
```
|
34
|
+
|
35
|
+
## Usage
|
36
|
+
|
37
|
+
Here's a comprehensive guide on how to use MareArts Crystal:
|
38
|
+
|
39
|
+
```python
|
40
|
+
from marearts_crystal import ma_crystal
|
41
|
+
|
42
|
+
# Initialize with a secret key
|
43
|
+
secret_key = "your_secret_key_here"
|
44
|
+
skm = ma_crystal(secret_key)
|
45
|
+
|
46
|
+
# Generate a serial key
|
47
|
+
username = "john_doe"
|
48
|
+
start_date = "2023-07-01"
|
49
|
+
end_date = "2023-12-31"
|
50
|
+
serial_key = skm.generate_serial_key(username, start_date, end_date)
|
51
|
+
print(f"Generated Serial Key: {serial_key}")
|
52
|
+
|
53
|
+
# Validate the serial key
|
54
|
+
validated_start, validated_end = skm.validate_serial_key(username, serial_key)
|
55
|
+
print(f"Validated Start Date: {validated_start}")
|
56
|
+
print(f"Validated End Date: {validated_end}")
|
57
|
+
|
58
|
+
# Date validation
|
59
|
+
if skm.validate_date("2024-07-01", "2024-12-31"):
|
60
|
+
print("Date range is valid")
|
61
|
+
else:
|
62
|
+
print("Date range is invalid")
|
63
|
+
|
64
|
+
# Get today's date
|
65
|
+
print("Today's date:", skm.get_today_date())
|
66
|
+
|
67
|
+
# Generate end dates
|
68
|
+
print("Tomorrow:", skm.generate_end_date(0, 0, 1))
|
69
|
+
print("Next month:", skm.generate_end_date(0, 1, 0))
|
70
|
+
print("Next year:", skm.generate_end_date(1, 0, 0))
|
71
|
+
|
72
|
+
# Try with an invalid key
|
73
|
+
invalid_result = skm.validate_serial_key(username, "invalid_key")
|
74
|
+
print(f"Invalid Key Result: {invalid_result}")
|
75
|
+
|
76
|
+
invalid_result = skm.validate_serial_key("wrong_name", serial_key)
|
77
|
+
print(f"Invalid Key Result: {invalid_result}")
|
78
|
+
|
79
|
+
# String encryption and decryption
|
80
|
+
original_string = "Hello, MareArts Crystal!"
|
81
|
+
encrypted = skm.encrypt_string(original_string)
|
82
|
+
print(f"Encrypted: {encrypted}")
|
83
|
+
|
84
|
+
decrypted = skm.decrypt_string(encrypted)
|
85
|
+
print(f"Decrypted: {decrypted}")
|
86
|
+
|
87
|
+
# Decryption with wrong key
|
88
|
+
wrong_key = "wrong_secret_key"
|
89
|
+
wrong_skm = ma_crystal(wrong_key)
|
90
|
+
wrong_decryption = wrong_skm.decrypt_string(encrypted)
|
91
|
+
print(f"Decryption with wrong key: {wrong_decryption}")
|
92
|
+
|
93
|
+
# File encryption and decryption
|
94
|
+
input_filename = "example.bin" # This can be any file, binary or text
|
95
|
+
output_encrypted_filename = "example_encrypted.bin"
|
96
|
+
|
97
|
+
# Read and encrypt the file
|
98
|
+
with open(input_filename, "rb") as file:
|
99
|
+
file_content = file.read()
|
100
|
+
encrypted_content = skm.encrypt_data(file_content)
|
101
|
+
|
102
|
+
# Save the encrypted content
|
103
|
+
with open(output_encrypted_filename, "wb") as file:
|
104
|
+
file.write(encrypted_content)
|
105
|
+
print(f"File '{input_filename}' has been encrypted and saved as '{output_encrypted_filename}'")
|
106
|
+
|
107
|
+
# Decrypt the file
|
108
|
+
input_encrypted_filename = output_encrypted_filename
|
109
|
+
output_decrypted_filename = "example_decrypted.bin"
|
110
|
+
|
111
|
+
# Read and decrypt the file
|
112
|
+
with open(input_encrypted_filename, "rb") as file:
|
113
|
+
encrypted_content = file.read()
|
114
|
+
decrypted_content = skm.decrypt_data(encrypted_content)
|
115
|
+
|
116
|
+
if decrypted_content:
|
117
|
+
# Save the decrypted content
|
118
|
+
with open(output_decrypted_filename, "wb") as file:
|
119
|
+
file.write(decrypted_content)
|
120
|
+
print(f"File '{input_encrypted_filename}' has been decrypted and saved as '{output_decrypted_filename}'")
|
121
|
+
else:
|
122
|
+
print("Decryption failed. The file might be corrupted or the wrong key was used.")
|
123
|
+
```
|
124
|
+
|
125
|
+
## Features
|
126
|
+
|
127
|
+
- Serial key generation and validation
|
128
|
+
- Date validation and manipulation
|
129
|
+
- String encryption and decryption
|
130
|
+
- File encryption and decryption
|
131
|
+
- Secure key management
|
132
|
+
|
133
|
+
## License
|
134
|
+
|
135
|
+
This project is licensed under the MIT License
|
136
|
+
|
137
|
+
|
138
|
+
## Support
|
139
|
+
|
140
|
+
www.marearts.com
|
141
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
marearts_crystal/__init__.py,sha256=VtyfnD_IJ_ZeQ0RSpcUBRpqblBIIER_-SrEsAJyoMfU,34
|
2
|
+
marearts_crystal/ma_crystal.cp39-win_amd64.pyd,sha256=Q6FFtRK_AojCr__1h8-A5aleaeZdXUNV8hbHQZjWX0Q,121856
|
3
|
+
marearts_crystal-1.0.3.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
marearts_crystal-1.0.3.dist-info/METADATA,sha256=r5E55ZJvONZNKlZJWFRn9MuJzsjK0pBv4IPHpsVUopg,4395
|
5
|
+
marearts_crystal-1.0.3.dist-info/WHEEL,sha256=YorN2HPccIdfJm1vtDZTOGjQ579sMRaAowQ3R-HpNAE,100
|
6
|
+
marearts_crystal-1.0.3.dist-info/top_level.txt,sha256=N9PKpzxPIIZdhvSjlhuEl1yqenIsFaCE2HIs77WPdHI,17
|
7
|
+
marearts_crystal-1.0.3.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
marearts_crystal
|