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