正在显示
1 个修改的文件
包含
5 行增加
和
0 行删除
... | ... | @@ -23,9 +23,14 @@ class SM2(): |
23 | 23 | publickey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEsENe/8Sft6rK0h59t2a/6Pf4nzvxvJzc1SzalZe1xSDtUqW/10E/e+RjRbvykyjKzu3vAY1lwv9aU2Tnp6+isw==" |
24 | 24 | sm2_crypt = sm2.CryptSM2(public_key=publickey, private_key=privatekey) |
25 | 25 | |
26 | + @classmethod | |
26 | 27 | def decode(self, ciphertxt): |
27 | 28 | return self.sm2_crypt.decrypt(ciphertxt) |
28 | 29 | |
30 | + @classmethod | |
31 | + def encode(self, plaintxt): | |
32 | + return self.sm2_crypt.encrypt(plaintxt) | |
33 | + | |
29 | 34 | |
30 | 35 | class DES(): |
31 | 36 | ''' | ... | ... |
请
注册
或
登录
后发表评论