spei-python 0.48.5__tar.gz → 0.48.6__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.
- {spei_python-0.48.5 → spei_python-0.48.6}/PKG-INFO +1 -1
- {spei_python-0.48.5 → spei_python-0.48.6}/pyproject.toml +2 -2
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/cep_generator.py +24 -16
- {spei_python-0.48.5 → spei_python-0.48.6}/README.md +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/README.md +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/__init__.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/checksum/__init__.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/checksum/factory.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/checksum/generator.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/checksum/types.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/client.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/errors/__init__.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/errors/sice.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/errors/spei.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/exceptions.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/mappings.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/requests/__init__.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/requests/acuse.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/requests/cda.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/requests/orden.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/requests/respuesta.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/resources/__init__.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/resources/acuse.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/resources/cda.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/resources/ensesion.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/resources/mensaje.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/resources/orden.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/resources/payments.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/resources/respuesta.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/responses/__init__.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/responses/acuse.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/responses/orden.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/responses/respuesta.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/sice.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/types/__init__.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/types/sice.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/types/spei.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/utils.py +0 -0
- {spei_python-0.48.5 → spei_python-0.48.6}/spei/validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "spei-python"
|
|
3
|
-
version = "0.48.
|
|
3
|
+
version = "0.48.6"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["tech <tech@fondeadora.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -32,7 +32,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
32
32
|
|
|
33
33
|
[tool.commitizen]
|
|
34
34
|
name = "cz_conventional_commits"
|
|
35
|
-
version = "0.48.
|
|
35
|
+
version = "0.48.6"
|
|
36
36
|
tag_format = "v$version"
|
|
37
37
|
bump_message = "bump: Semantic Release Bot: Release Version: $new_version 🤖🚀 [skip ci]"
|
|
38
38
|
version_files = [
|
|
@@ -44,37 +44,45 @@ class CepGenerator(object):
|
|
|
44
44
|
return self._encrypt_string(string)
|
|
45
45
|
|
|
46
46
|
def decrypt_string(self, encrypted_data_base64: str) -> str: # noqa: WPS210
|
|
47
|
-
backend = default_backend()
|
|
48
47
|
encrypted_data = base64.b64decode(encrypted_data_base64)
|
|
49
48
|
iv = encrypted_data[:IV_LIMIT]
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
decryptor = self.decryptor(iv)
|
|
50
|
+
|
|
51
|
+
decrypted_data = (
|
|
52
|
+
decryptor.update(
|
|
53
|
+
encrypted_data[IV_LIMIT:],
|
|
54
|
+
)
|
|
55
|
+
+ decryptor.finalize()
|
|
54
56
|
)
|
|
55
|
-
|
|
56
|
-
decrypted_data = decryptor.update(
|
|
57
|
-
encrypted_data[IV_LIMIT:],
|
|
58
|
-
) + decryptor.finalize()
|
|
57
|
+
|
|
59
58
|
unpadder = padding.PKCS7(algorithms.AES.block_size).unpadder()
|
|
60
59
|
unpadded_data = unpadder.update(decrypted_data) + unpadder.finalize()
|
|
61
60
|
|
|
62
61
|
return unpadded_data.decode()
|
|
63
62
|
|
|
63
|
+
def encryptor(self, iv: bytes, backend=None):
|
|
64
|
+
return self.cipher(iv, backend=backend).encryptor()
|
|
65
|
+
|
|
66
|
+
def decryptor(self, iv: bytes, backend=None):
|
|
67
|
+
return self.cipher(iv, backend=backend).decryptor()
|
|
68
|
+
|
|
69
|
+
def cipher(self, iv: bytes, backend=None):
|
|
70
|
+
return Cipher(
|
|
71
|
+
algorithms.AES(base64.b64decode(self.key_base64)),
|
|
72
|
+
modes.CBC(iv),
|
|
73
|
+
backend=backend or default_backend(),
|
|
74
|
+
)
|
|
75
|
+
|
|
64
76
|
def _format_date(self, date: datetime.datetime) -> str:
|
|
65
77
|
return date.strftime('%Y%m%d')
|
|
66
78
|
|
|
67
79
|
def _encrypt_string(self, string: str) -> str: # noqa: WPS210
|
|
68
|
-
backend = default_backend()
|
|
69
80
|
iv = self.rng(IV_LIMIT)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
modes.CBC(iv),
|
|
73
|
-
backend=backend,
|
|
74
|
-
)
|
|
75
|
-
encryptor = cipher.encryptor()
|
|
81
|
+
encryptor = self.encryptor(iv)
|
|
82
|
+
|
|
76
83
|
padder = padding.PKCS7(algorithms.AES.block_size).padder()
|
|
77
84
|
padded_data = padder.update(string.encode()) + padder.finalize()
|
|
85
|
+
|
|
78
86
|
encrypted_data = encryptor.update(padded_data) + encryptor.finalize()
|
|
79
87
|
encrypted_data_base64 = base64.b64encode(iv + encrypted_data)
|
|
80
88
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|