marearts-crystal 0.0.316016__tar.gz

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.
File without changes
@@ -0,0 +1,7 @@
1
+ include README.md
2
+ include LICENSE
3
+ global-exclude __pycache__
4
+ global-exclude *.py[cod]
5
+ global-exclude *.cpp
6
+ global-exclude *.c
7
+ global-exclude *.pyc
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.2
2
+ Name: marearts-crystal
3
+ Version: 0.0.316016
4
+ Summary: marearts crystal for encryption and decryption
5
+ Home-page: https://www.marearts.com
6
+ Author: MareArts
7
+ Author-email: MareArts <hello@marearts.com>
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: <3.12,>=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: cffi==1.16.0
17
+ Requires-Dist: cryptography==43.0.0
18
+ Requires-Dist: pycparser==2.22
19
+
20
+ # MareArts Crystal
21
+
22
+ 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.
23
+
24
+ ## Installation
25
+
26
+ Install MareArts Crystal using pip:
27
+
28
+ ```bash
29
+ pip install marearts-crystal
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ Here's a comprehensive guide on how to use MareArts Crystal:
35
+
36
+ ```python
37
+ from marearts_crystal import ma_crystal
38
+
39
+ # Initialize with a secret key
40
+ secret_key = "your_secret_key_here"
41
+ skm = ma_crystal(secret_key)
42
+
43
+ # Generate a serial key
44
+ username = "john_doe"
45
+ start_date = "2023-07-01"
46
+ end_date = "2023-12-31"
47
+ serial_key = skm.generate_serial_key(username, start_date, end_date)
48
+ print(f"Generated Serial Key: {serial_key}")
49
+
50
+ # Validate the serial key
51
+ validated_start, validated_end = skm.validate_serial_key(username, serial_key)
52
+ print(f"Validated Start Date: {validated_start}")
53
+ print(f"Validated End Date: {validated_end}")
54
+
55
+ # Date validation
56
+ if skm.validate_date("2024-07-01", "2024-12-31"):
57
+ print("Date range is valid")
58
+ else:
59
+ print("Date range is invalid")
60
+
61
+ # Get today's date
62
+ print("Today's date:", skm.get_today_date())
63
+
64
+ # Generate end dates
65
+ print("Tomorrow:", skm.generate_end_date(0, 0, 1))
66
+ print("Next month:", skm.generate_end_date(0, 1, 0))
67
+ print("Next year:", skm.generate_end_date(1, 0, 0))
68
+
69
+ # Try with an invalid key
70
+ invalid_result = skm.validate_serial_key(username, "invalid_key")
71
+ print(f"Invalid Key Result: {invalid_result}")
72
+
73
+ invalid_result = skm.validate_serial_key("wrong_name", serial_key)
74
+ print(f"Invalid Key Result: {invalid_result}")
75
+
76
+ # String encryption and decryption
77
+ original_string = "Hello, MareArts Crystal!"
78
+ encrypted = skm.encrypt_string(original_string)
79
+ print(f"Encrypted: {encrypted}")
80
+
81
+ decrypted = skm.decrypt_string(encrypted)
82
+ print(f"Decrypted: {decrypted}")
83
+
84
+ # Decryption with wrong key
85
+ wrong_key = "wrong_secret_key"
86
+ wrong_skm = ma_crystal(wrong_key)
87
+ wrong_decryption = wrong_skm.decrypt_string(encrypted)
88
+ print(f"Decryption with wrong key: {wrong_decryption}")
89
+
90
+ # File encryption and decryption
91
+ input_filename = "example.bin" # This can be any file, binary or text
92
+ output_encrypted_filename = "example_encrypted.bin"
93
+
94
+ # Read and encrypt the file
95
+ with open(input_filename, "rb") as file:
96
+ file_content = file.read()
97
+ encrypted_content = skm.encrypt_data(file_content)
98
+
99
+ # Save the encrypted content
100
+ with open(output_encrypted_filename, "wb") as file:
101
+ file.write(encrypted_content)
102
+ print(f"File '{input_filename}' has been encrypted and saved as '{output_encrypted_filename}'")
103
+
104
+ # Decrypt the file
105
+ input_encrypted_filename = output_encrypted_filename
106
+ output_decrypted_filename = "example_decrypted.bin"
107
+
108
+ # Read and decrypt the file
109
+ with open(input_encrypted_filename, "rb") as file:
110
+ encrypted_content = file.read()
111
+ decrypted_content = skm.decrypt_data(encrypted_content)
112
+
113
+ if decrypted_content:
114
+ # Save the decrypted content
115
+ with open(output_decrypted_filename, "wb") as file:
116
+ file.write(decrypted_content)
117
+ print(f"File '{input_encrypted_filename}' has been decrypted and saved as '{output_decrypted_filename}'")
118
+ else:
119
+ print("Decryption failed. The file might be corrupted or the wrong key was used.")
120
+ ```
121
+
122
+ ## Features
123
+
124
+ - Serial key generation and validation
125
+ - Date validation and manipulation
126
+ - String encryption and decryption
127
+ - File encryption and decryption
128
+ - Secure key management
129
+
130
+ ## License
131
+
132
+ This project is licensed under the MIT License
133
+
134
+
135
+ ## Support
136
+
137
+ www.marearts.com
@@ -0,0 +1,118 @@
1
+ # MareArts Crystal
2
+
3
+ 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.
4
+
5
+ ## Installation
6
+
7
+ Install MareArts Crystal using pip:
8
+
9
+ ```bash
10
+ pip install marearts-crystal
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Here's a comprehensive guide on how to use MareArts Crystal:
16
+
17
+ ```python
18
+ from marearts_crystal import ma_crystal
19
+
20
+ # Initialize with a secret key
21
+ secret_key = "your_secret_key_here"
22
+ skm = ma_crystal(secret_key)
23
+
24
+ # Generate a serial key
25
+ username = "john_doe"
26
+ start_date = "2023-07-01"
27
+ end_date = "2023-12-31"
28
+ serial_key = skm.generate_serial_key(username, start_date, end_date)
29
+ print(f"Generated Serial Key: {serial_key}")
30
+
31
+ # Validate the serial key
32
+ validated_start, validated_end = skm.validate_serial_key(username, serial_key)
33
+ print(f"Validated Start Date: {validated_start}")
34
+ print(f"Validated End Date: {validated_end}")
35
+
36
+ # Date validation
37
+ if skm.validate_date("2024-07-01", "2024-12-31"):
38
+ print("Date range is valid")
39
+ else:
40
+ print("Date range is invalid")
41
+
42
+ # Get today's date
43
+ print("Today's date:", skm.get_today_date())
44
+
45
+ # Generate end dates
46
+ print("Tomorrow:", skm.generate_end_date(0, 0, 1))
47
+ print("Next month:", skm.generate_end_date(0, 1, 0))
48
+ print("Next year:", skm.generate_end_date(1, 0, 0))
49
+
50
+ # Try with an invalid key
51
+ invalid_result = skm.validate_serial_key(username, "invalid_key")
52
+ print(f"Invalid Key Result: {invalid_result}")
53
+
54
+ invalid_result = skm.validate_serial_key("wrong_name", serial_key)
55
+ print(f"Invalid Key Result: {invalid_result}")
56
+
57
+ # String encryption and decryption
58
+ original_string = "Hello, MareArts Crystal!"
59
+ encrypted = skm.encrypt_string(original_string)
60
+ print(f"Encrypted: {encrypted}")
61
+
62
+ decrypted = skm.decrypt_string(encrypted)
63
+ print(f"Decrypted: {decrypted}")
64
+
65
+ # Decryption with wrong key
66
+ wrong_key = "wrong_secret_key"
67
+ wrong_skm = ma_crystal(wrong_key)
68
+ wrong_decryption = wrong_skm.decrypt_string(encrypted)
69
+ print(f"Decryption with wrong key: {wrong_decryption}")
70
+
71
+ # File encryption and decryption
72
+ input_filename = "example.bin" # This can be any file, binary or text
73
+ output_encrypted_filename = "example_encrypted.bin"
74
+
75
+ # Read and encrypt the file
76
+ with open(input_filename, "rb") as file:
77
+ file_content = file.read()
78
+ encrypted_content = skm.encrypt_data(file_content)
79
+
80
+ # Save the encrypted content
81
+ with open(output_encrypted_filename, "wb") as file:
82
+ file.write(encrypted_content)
83
+ print(f"File '{input_filename}' has been encrypted and saved as '{output_encrypted_filename}'")
84
+
85
+ # Decrypt the file
86
+ input_encrypted_filename = output_encrypted_filename
87
+ output_decrypted_filename = "example_decrypted.bin"
88
+
89
+ # Read and decrypt the file
90
+ with open(input_encrypted_filename, "rb") as file:
91
+ encrypted_content = file.read()
92
+ decrypted_content = skm.decrypt_data(encrypted_content)
93
+
94
+ if decrypted_content:
95
+ # Save the decrypted content
96
+ with open(output_decrypted_filename, "wb") as file:
97
+ file.write(decrypted_content)
98
+ print(f"File '{input_encrypted_filename}' has been decrypted and saved as '{output_decrypted_filename}'")
99
+ else:
100
+ print("Decryption failed. The file might be corrupted or the wrong key was used.")
101
+ ```
102
+
103
+ ## Features
104
+
105
+ - Serial key generation and validation
106
+ - Date validation and manipulation
107
+ - String encryption and decryption
108
+ - File encryption and decryption
109
+ - Secure key management
110
+
111
+ ## License
112
+
113
+ This project is licensed under the MIT License
114
+
115
+
116
+ ## Support
117
+
118
+ www.marearts.com
@@ -0,0 +1 @@
1
+ from .ma_crystal import ma_crystal
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.2
2
+ Name: marearts-crystal
3
+ Version: 0.0.316016
4
+ Summary: marearts crystal for encryption and decryption
5
+ Home-page: https://www.marearts.com
6
+ Author: MareArts
7
+ Author-email: MareArts <hello@marearts.com>
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: <3.12,>=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: cffi==1.16.0
17
+ Requires-Dist: cryptography==43.0.0
18
+ Requires-Dist: pycparser==2.22
19
+
20
+ # MareArts Crystal
21
+
22
+ 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.
23
+
24
+ ## Installation
25
+
26
+ Install MareArts Crystal using pip:
27
+
28
+ ```bash
29
+ pip install marearts-crystal
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ Here's a comprehensive guide on how to use MareArts Crystal:
35
+
36
+ ```python
37
+ from marearts_crystal import ma_crystal
38
+
39
+ # Initialize with a secret key
40
+ secret_key = "your_secret_key_here"
41
+ skm = ma_crystal(secret_key)
42
+
43
+ # Generate a serial key
44
+ username = "john_doe"
45
+ start_date = "2023-07-01"
46
+ end_date = "2023-12-31"
47
+ serial_key = skm.generate_serial_key(username, start_date, end_date)
48
+ print(f"Generated Serial Key: {serial_key}")
49
+
50
+ # Validate the serial key
51
+ validated_start, validated_end = skm.validate_serial_key(username, serial_key)
52
+ print(f"Validated Start Date: {validated_start}")
53
+ print(f"Validated End Date: {validated_end}")
54
+
55
+ # Date validation
56
+ if skm.validate_date("2024-07-01", "2024-12-31"):
57
+ print("Date range is valid")
58
+ else:
59
+ print("Date range is invalid")
60
+
61
+ # Get today's date
62
+ print("Today's date:", skm.get_today_date())
63
+
64
+ # Generate end dates
65
+ print("Tomorrow:", skm.generate_end_date(0, 0, 1))
66
+ print("Next month:", skm.generate_end_date(0, 1, 0))
67
+ print("Next year:", skm.generate_end_date(1, 0, 0))
68
+
69
+ # Try with an invalid key
70
+ invalid_result = skm.validate_serial_key(username, "invalid_key")
71
+ print(f"Invalid Key Result: {invalid_result}")
72
+
73
+ invalid_result = skm.validate_serial_key("wrong_name", serial_key)
74
+ print(f"Invalid Key Result: {invalid_result}")
75
+
76
+ # String encryption and decryption
77
+ original_string = "Hello, MareArts Crystal!"
78
+ encrypted = skm.encrypt_string(original_string)
79
+ print(f"Encrypted: {encrypted}")
80
+
81
+ decrypted = skm.decrypt_string(encrypted)
82
+ print(f"Decrypted: {decrypted}")
83
+
84
+ # Decryption with wrong key
85
+ wrong_key = "wrong_secret_key"
86
+ wrong_skm = ma_crystal(wrong_key)
87
+ wrong_decryption = wrong_skm.decrypt_string(encrypted)
88
+ print(f"Decryption with wrong key: {wrong_decryption}")
89
+
90
+ # File encryption and decryption
91
+ input_filename = "example.bin" # This can be any file, binary or text
92
+ output_encrypted_filename = "example_encrypted.bin"
93
+
94
+ # Read and encrypt the file
95
+ with open(input_filename, "rb") as file:
96
+ file_content = file.read()
97
+ encrypted_content = skm.encrypt_data(file_content)
98
+
99
+ # Save the encrypted content
100
+ with open(output_encrypted_filename, "wb") as file:
101
+ file.write(encrypted_content)
102
+ print(f"File '{input_filename}' has been encrypted and saved as '{output_encrypted_filename}'")
103
+
104
+ # Decrypt the file
105
+ input_encrypted_filename = output_encrypted_filename
106
+ output_decrypted_filename = "example_decrypted.bin"
107
+
108
+ # Read and decrypt the file
109
+ with open(input_encrypted_filename, "rb") as file:
110
+ encrypted_content = file.read()
111
+ decrypted_content = skm.decrypt_data(encrypted_content)
112
+
113
+ if decrypted_content:
114
+ # Save the decrypted content
115
+ with open(output_decrypted_filename, "wb") as file:
116
+ file.write(decrypted_content)
117
+ print(f"File '{input_encrypted_filename}' has been decrypted and saved as '{output_decrypted_filename}'")
118
+ else:
119
+ print("Decryption failed. The file might be corrupted or the wrong key was used.")
120
+ ```
121
+
122
+ ## Features
123
+
124
+ - Serial key generation and validation
125
+ - Date validation and manipulation
126
+ - String encryption and decryption
127
+ - File encryption and decryption
128
+ - Secure key management
129
+
130
+ ## License
131
+
132
+ This project is licensed under the MIT License
133
+
134
+
135
+ ## Support
136
+
137
+ www.marearts.com
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ setup.cfg
6
+ setup.py
7
+ marearts_crystal/__init__.py
8
+ marearts_crystal.egg-info/PKG-INFO
9
+ marearts_crystal.egg-info/SOURCES.txt
10
+ marearts_crystal.egg-info/dependency_links.txt
11
+ marearts_crystal.egg-info/requires.txt
12
+ marearts_crystal.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ cffi==1.16.0
2
+ cryptography==43.0.0
3
+ pycparser==2.22
@@ -0,0 +1 @@
1
+ marearts_crystal
@@ -0,0 +1,29 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel", "cython"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "marearts-crystal"
7
+ version = "0.0.316016"
8
+ authors = [
9
+ {name = "MareArts", email = "hello@marearts.com"}
10
+ ]
11
+ description = "marearts crystal for encryption and decryption"
12
+ readme = "README.md"
13
+ requires-python = ">=3.9, <3.12"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3.9",
16
+ "Programming Language :: Python :: 3.10",
17
+ "Programming Language :: Python :: 3.11",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent"
20
+ ]
21
+
22
+ dependencies = [
23
+ "cffi==1.16.0",
24
+ "cryptography==43.0.0",
25
+ "pycparser==2.22"
26
+ ]
27
+
28
+ [tool.setuptools]
29
+ packages = ["marearts_crystal"]
@@ -0,0 +1,35 @@
1
+ [metadata]
2
+ name = marearts-crystal
3
+ version = 0.0.316016
4
+ author = MareArts
5
+ author_email = hello@marearts.com
6
+ description = marearts crystal for encryption and decryption
7
+ long_description = file: README.md
8
+ long_description_content_type = text/markdown
9
+ url = https://www.marearts.com
10
+ classifiers =
11
+ Programming Language :: Python :: 3.9
12
+ Programming Language :: Python :: 3.10
13
+ Programming Language :: Python :: 3.11
14
+ License :: OSI Approved :: MIT License
15
+ Operating System :: OS Independent
16
+
17
+ [options]
18
+ packages = find:
19
+ python_requires = >=3.9, <3.12
20
+ install_requires =
21
+ cffi==1.16.0
22
+ cryptography==43.0.0
23
+ pycparser==2.22
24
+ include_package_data = true
25
+
26
+ [bdist_wheel]
27
+ universal = 1
28
+
29
+ [options.packages.find]
30
+ where = .
31
+
32
+ [egg_info]
33
+ tag_build =
34
+ tag_date = 0
35
+
@@ -0,0 +1,30 @@
1
+ from setuptools import setup, Extension
2
+ from Cython.Build import cythonize
3
+ from wheel.bdist_wheel import bdist_wheel
4
+
5
+ class BdistWheelCommand(bdist_wheel):
6
+ def finalize_options(self):
7
+ bdist_wheel.finalize_options(self)
8
+ self.root_is_pure = False
9
+ self.plat_name_supplied = True
10
+
11
+ # Define the extension
12
+ ext_modules = [
13
+ Extension(
14
+ "marearts_crystal.ma_crystal",
15
+ ["marearts_crystal/ma_crystal.pyx"]
16
+ )
17
+ ]
18
+
19
+ # Compile the extension
20
+ compiled_ext_modules = cythonize(
21
+ ext_modules,
22
+ compiler_directives={'language_level': "3"}
23
+ )
24
+
25
+ if __name__ == '__main__':
26
+ setup(
27
+ ext_modules=compiled_ext_modules,
28
+ cmdclass={'bdist_wheel': BdistWheelCommand},
29
+ include_package_data=True,
30
+ )