Replies: 2 comments 2 replies
-
You shouldn't be using a public key algorithm to encrypt bulk data. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Apart from being very slow, there are no cipher modes defined for asymmetric algorithms, so you're essentially using ECB mode which has some known issues. Just don't. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have successfully compiled 3.1.1 .According to various information on the Internet, the function of SM2 encryption is implemented.But the length of the ciphertext is wrong.
Generate the EVP_Pkey through HEX:
encrypt code:
priKey hex:
D07E969F55F8D8D1F813A0EF0237CF93E53679A3CB65FD42FD9EB3239DBE5BF5
pubKey hex:
A40C45E02417662AF9DA9EEC5953E8604FB2D59BC3EAE5AABE1D7540B588941E6484EEC9DDCF46B84D198E6659770484A38CCC0646A7546FE5AB2E3D5CD2CF03
original text:123
0x495051
ciphertext,the length is 111
306D022100D6745DA3D9DFFA524C28F604044BF72F001DFCA7201B5F25F5A65E8A37E7E403022100B18DD514D804A523E1DC43BCF3E1EAB8F464B7DC3466144A86AEACCF0EEE420B04209CD81FF4E9AD4BEBB5C69FB62ECE71272E3E375706488C6886CE0434C82DF87B040329106B
I use the online SM2 tool,use the same pubkey,the length of ciphertext is 99:
6F2FC4248432255EDD9641D45D6753C7F27A914BB91303D6A08D34C5F9CDD6934205A86FFDE49B1C9D7AF58C57A96CC0963C3E671F37A4A49CD7894875B9987F942FE2EF8F25686329C92047D3CB674E37760B03BB647F0D67972D0B05AC0DCFA7167A
Why is the length different?where is the trouble?
CMD:
I'm sure I have administrator rights and can execute the mkdir command and I have successfully compiled 3.1.1.
what's wrong!
Beta Was this translation helpful? Give feedback.
All reactions