diff --git a/bkcrypto/contrib/django/ciphers.py b/bkcrypto/contrib/django/ciphers.py index edaae0f..dab91d9 100644 --- a/bkcrypto/contrib/django/ciphers.py +++ b/bkcrypto/contrib/django/ciphers.py @@ -41,7 +41,7 @@ def get_symmetric_cipher( cipher_options: typing.Optional[typing.Dict[str, typing.Optional[SymmetricOptions]]] = None, ) -> BaseSymmetricCipher: return ciphers.get_symmetric_cipher( - cipher_type=cipher_type or crypto_settings.ASYMMETRIC_CIPHER_TYPE, + cipher_type=cipher_type or crypto_settings.SYMMETRIC_CIPHER_TYPE, common=common, cipher_options=cipher_options, symmetric_cipher_classes=crypto_settings.SYMMETRIC_CIPHER_CLASSES, diff --git a/pyproject.toml b/pyproject.toml index 670b44c..a29229a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bk-crypto-python-sdk" -version = "1.1.0" +version = "1.1.1" description = "bk-crypto-python-sdk is a lightweight cryptography toolkit for Python applications based on Cryptodome / tongsuopy and other encryption libraries." authors = ["TencentBlueKing "] readme = "readme.md" diff --git a/readme.md b/readme.md index 1aadcb7..157a931 100644 --- a/readme.md +++ b/readme.md @@ -129,7 +129,7 @@ assert "123" == symmetric_cipher.decrypt(symmetric_cipher.encrypt("123")) ```python from bkcrypto import constants from bkcrypto.symmetric.options import AESSymmetricOptions, SM4SymmetricOptions -from bkcrypto.asymmetric.options import RSAAsymmetricOptions +from bkcrypto.asymmetric.options import RSAAsymmetricOptions, SM2AsymmetricOptions BKCRYPTO = { # 声明项目所使用的非对称加密算法 @@ -162,9 +162,9 @@ BKCRYPTO = { "common": {"public_key_string": "your key"}, "cipher_options": { constants.AsymmetricCipherType.RSA.value: RSAAsymmetricOptions( - padding=constants.RSACipherPadding.PKCS1_OAEP + padding=constants.RSACipherPadding.PKCS1_v1_5 ), - constants.AsymmetricCipherType.SM2.value: SM4SymmetricOptions() + constants.AsymmetricCipherType.SM2.value: SM2AsymmetricOptions() }, }, } diff --git a/readme_en.md b/readme_en.md index 18a71ff..b138bef 100644 --- a/readme_en.md +++ b/readme_en.md @@ -132,7 +132,7 @@ Configure the encryption algorithm type in Django Settings ```python from bkcrypto import constants from bkcrypto.symmetric.options import AESSymmetricOptions, SM4SymmetricOptions -from bkcrypto.asymmetric.options import RSAAsymmetricOptions +from bkcrypto.asymmetric.options import RSAAsymmetricOptions, SM2AsymmetricOptions BKCRYPTO = { # Declare the asymmetric encryption algorithm used by the project @@ -167,7 +167,7 @@ BKCRYPTO = { constants.AsymmetricCipherType.RSA.value: RSAAsymmetricOptions( padding=constants.RSACipherPadding.PKCS1_OAEP ), - constants.AsymmetricCipherType.SM2.value: SM4SymmetricOptions() + constants.AsymmetricCipherType.SM2.value: SM2AsymmetricOptions() }, }, } diff --git a/release.md b/release.md index a501de5..cef8035 100644 --- a/release.md +++ b/release.md @@ -46,3 +46,10 @@ * [ Feature ] Add support for non-Django projects ([#19](https://github.com/TencentBlueKing/crypto-python-sdk/issues/19)) * [ Feature ] Add support for prefix ciphertext decryption ([#20](https://github.com/TencentBlueKing/crypto-python-sdk/issues/20)) + + +## 1.1.1 - 2023-08-16 + +### Fixed + +* [ Fixed ] Fix the issue of get_symmetric_cipher has wrong default value ([#25](https://github.com/TencentBlueKing/crypto-python-sdk/issues/25))