File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " bk-crypto-python-sdk"
3- version = " 1.1.0 "
3+ version = " 1.1.1 "
44description = " bk-crypto-python-sdk is a lightweight cryptography toolkit for Python applications based on Cryptodome / tongsuopy and other encryption libraries."
55authors = [" TencentBlueKing <contactus_bk@tencent.com>" ]
66readme = " readme.md"
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ assert "123" == symmetric_cipher.decrypt(symmetric_cipher.encrypt("123"))
129129``` python
130130from bkcrypto import constants
131131from bkcrypto.symmetric.options import AESSymmetricOptions, SM4SymmetricOptions
132- from bkcrypto.asymmetric.options import RSAAsymmetricOptions
132+ from bkcrypto.asymmetric.options import RSAAsymmetricOptions, SM2AsymmetricOptions
133133
134134BKCRYPTO = {
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 }
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ Configure the encryption algorithm type in Django Settings
132132``` python
133133from bkcrypto import constants
134134from bkcrypto.symmetric.options import AESSymmetricOptions, SM4SymmetricOptions
135- from bkcrypto.asymmetric.options import RSAAsymmetricOptions
135+ from bkcrypto.asymmetric.options import RSAAsymmetricOptions, SM2AsymmetricOptions
136136
137137BKCRYPTO = {
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 }
Original file line number Diff line number Diff line change 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 ) )
You can’t perform that action at this time.
0 commit comments