Skip to content

Commit aa05169

Browse files
fix: Fix the issue of get_symmetric_cipher has wrong default value (fixed #25)
1 parent e640562 commit aa05169

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

bkcrypto/contrib/django/ciphers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_symmetric_cipher(
4141
cipher_options: typing.Optional[typing.Dict[str, typing.Optional[SymmetricOptions]]] = None,
4242
) -> BaseSymmetricCipher:
4343
return ciphers.get_symmetric_cipher(
44-
cipher_type=cipher_type or crypto_settings.ASYMMETRIC_CIPHER_TYPE,
44+
cipher_type=cipher_type or crypto_settings.SYMMETRIC_CIPHER_TYPE,
4545
common=common,
4646
cipher_options=cipher_options,
4747
symmetric_cipher_classes=crypto_settings.SYMMETRIC_CIPHER_CLASSES,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "bk-crypto-python-sdk"
3-
version = "1.1.0"
3+
version = "1.1.1"
44
description = "bk-crypto-python-sdk is a lightweight cryptography toolkit for Python applications based on Cryptodome / tongsuopy and other encryption libraries."
55
authors = ["TencentBlueKing <[email protected]>"]
66
readme = "readme.md"

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ assert "123" == symmetric_cipher.decrypt(symmetric_cipher.encrypt("123"))
129129
```python
130130
from bkcrypto import constants
131131
from bkcrypto.symmetric.options import AESSymmetricOptions, SM4SymmetricOptions
132-
from bkcrypto.asymmetric.options import RSAAsymmetricOptions
132+
from bkcrypto.asymmetric.options import RSAAsymmetricOptions, SM2AsymmetricOptions
133133

134134
BKCRYPTO = {
135135
# 声明项目所使用的非对称加密算法
@@ -162,9 +162,9 @@ BKCRYPTO = {
162162
"common": {"public_key_string": "your key"},
163163
"cipher_options": {
164164
constants.AsymmetricCipherType.RSA.value: RSAAsymmetricOptions(
165-
padding=constants.RSACipherPadding.PKCS1_OAEP
165+
padding=constants.RSACipherPadding.PKCS1_v1_5
166166
),
167-
constants.AsymmetricCipherType.SM2.value: SM4SymmetricOptions()
167+
constants.AsymmetricCipherType.SM2.value: SM2AsymmetricOptions()
168168
},
169169
},
170170
}

readme_en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Configure the encryption algorithm type in Django Settings
132132
```python
133133
from bkcrypto import constants
134134
from bkcrypto.symmetric.options import AESSymmetricOptions, SM4SymmetricOptions
135-
from bkcrypto.asymmetric.options import RSAAsymmetricOptions
135+
from bkcrypto.asymmetric.options import RSAAsymmetricOptions, SM2AsymmetricOptions
136136

137137
BKCRYPTO = {
138138
# Declare the asymmetric encryption algorithm used by the project
@@ -167,7 +167,7 @@ BKCRYPTO = {
167167
constants.AsymmetricCipherType.RSA.value: RSAAsymmetricOptions(
168168
padding=constants.RSACipherPadding.PKCS1_OAEP
169169
),
170-
constants.AsymmetricCipherType.SM2.value: SM4SymmetricOptions()
170+
constants.AsymmetricCipherType.SM2.value: SM2AsymmetricOptions()
171171
},
172172
},
173173
}

release.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,10 @@
4646

4747
* [ Feature ] Add support for non-Django projects ([#19](https://github.com/TencentBlueKing/crypto-python-sdk/issues/19))
4848
* [ Feature ] Add support for prefix ciphertext decryption ([#20](https://github.com/TencentBlueKing/crypto-python-sdk/issues/20))
49+
50+
51+
## 1.1.1 - 2023-08-16
52+
53+
### Fixed
54+
55+
* [ Fixed ] Fix the issue of get_symmetric_cipher has wrong default value ([#25](https://github.com/TencentBlueKing/crypto-python-sdk/issues/25))

0 commit comments

Comments
 (0)