transcrypto 1.3.0__py3-none-any.whl → 1.4.0__py3-none-any.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.
- transcrypto/aes.py +10 -2
- transcrypto/base.py +708 -100
- transcrypto/constants.py +1921 -0
- transcrypto/dsa.py +16 -2
- transcrypto/modmath.py +37 -419
- transcrypto/profiler.py +191 -0
- transcrypto/safetrans.py +1231 -0
- transcrypto/transcrypto.py +14 -180
- transcrypto-1.4.0.dist-info/METADATA +1071 -0
- transcrypto-1.4.0.dist-info/RECORD +18 -0
- transcrypto-1.3.0.dist-info/METADATA +0 -2562
- transcrypto-1.3.0.dist-info/RECORD +0 -15
- {transcrypto-1.3.0.dist-info → transcrypto-1.4.0.dist-info}/WHEEL +0 -0
- {transcrypto-1.3.0.dist-info → transcrypto-1.4.0.dist-info}/licenses/LICENSE +0 -0
- {transcrypto-1.3.0.dist-info → transcrypto-1.4.0.dist-info}/top_level.txt +0 -0
transcrypto/aes.py
CHANGED
|
@@ -178,13 +178,21 @@ class AESKey(base.CryptoKey, base.Encryptor, base.Decryptor):
|
|
|
178
178
|
return decryptor.update(ciphertext) + decryptor.finalize()
|
|
179
179
|
|
|
180
180
|
def EncryptHex(self, plaintext_hex: str, /) -> str:
|
|
181
|
-
"""Encrypt a
|
|
181
|
+
"""Encrypt a 128 bits hexadecimal block, outputting also a 128 bits hexadecimal block."""
|
|
182
182
|
return base.BytesToHex(self.Encrypt(base.HexToBytes(plaintext_hex)))
|
|
183
183
|
|
|
184
|
+
def EncryptHex256(self, plaintext_hex: str, /) -> str:
|
|
185
|
+
"""Encrypt a 256 bits hexadecimal block, outputting also a 256 bits hexadecimal block."""
|
|
186
|
+
return self.EncryptHex(plaintext_hex[:32]) + self.EncryptHex(plaintext_hex[32:])
|
|
187
|
+
|
|
184
188
|
def DecryptHex(self, ciphertext_hex: str, /) -> str:
|
|
185
|
-
"""Decrypt a
|
|
189
|
+
"""Decrypt a 128 bits hexadecimal block, outputting also a 128 bits hexadecimal block."""
|
|
186
190
|
return base.BytesToHex(self.Decrypt(base.HexToBytes(ciphertext_hex)))
|
|
187
191
|
|
|
192
|
+
def DecryptHex256(self, ciphertext_hex: str, /) -> str:
|
|
193
|
+
"""Decrypt a 256 bits hexadecimal block, outputting also a 256 bits hexadecimal block."""
|
|
194
|
+
return self.DecryptHex(ciphertext_hex[:32]) + self.DecryptHex(ciphertext_hex[32:])
|
|
195
|
+
|
|
188
196
|
def ECBEncoder(self) -> AESKey.ECBEncoderClass:
|
|
189
197
|
"""Return a AESKey.ECBEncoderClass object using this key."""
|
|
190
198
|
return AESKey.ECBEncoderClass(self)
|