SM2 Algorithm Encryption and Decryption sample
generating SM2 keypair, SM2 Algorithm Encryption and Decryption
Home
|
SM2 sample
|
SM2 Cert Verifcation
|
SM2 Encryption and Decryption sample
(Step1) choose supported EC curve name and generate key pair
ECC curve name:
SM2
secp256r1 (= NIST P-256, P-256, prime256v1)
secp256k1
secp384r1 (= NIST P-384, P-384)
EC private key (hex):
EC public key (hex):
(Step2) Crypt message
Crypt Options:
C1C3C2
C1C2C3
Message string to be Crypted:
Crypt value (hex):
(Step3) Decrypt message
SM2 Certificate Encryption
SM2证书加密
原始数据:
证书数据:
MIICQDCCAeWgAwIBAgIQG2THdO0arf/KaLKoTVlCOzAMBggqgRzPVQGDdQUAMB8xEDAOBgNVBAMMB1NNMlJPT1QxCzAJBgNVBAYTAkNOMB4XDTE0MDYxODEzNTgzNVoXDTE2MDYxODEzNTgzNVowZTEiMCAGCSqGSIb3DQEJARYTam9ubGxlbkBob3RtYWlsLmNvbTEPMA0GA1UEBwwG6ZW/5rKZMQ8wDQYDVQQIDAbmuZbljZcxCzAJBgNVBAYTAkNOMRAwDgYDVQQDDAdKb25sbGVuMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEXLAuT39XB5LJmTprFiGLPfqZl5tyGm1n9oXSVDrGRP2RfQRJOqD6cH6PEvmGhM1ydJv0iQMg2mvh6PjAlm58W6OBujCBtzAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBQstXX3UIwlBK9k70GJYGM8mjG6gTAfBgNVHSMEGDAWgBQ/LpOmNnAJt7mAwIZpsX3cnqlkqjBCBggrBgEFBQcBAQQ2MDQwMgYIKwYBBQUHMAKGJmh0dHA6Ly9sb2NhbGhvc3QvUEtJL2NlcnRzL0RTQVJPT1QuY3J0MA4GA1UdDwEB/wQEAwIE8DATBgNVHSUEDDAKBggrBgEFBQcDAjAMBggqgRzPVQGDdQUAA0cAMEQCIBJO7K/XDt+igzKkWSkbRKZRtQKsS1i2Fmdp2Ar5EEL+AiA759mE/uINaEC7sMXOoqzTzkLCMIHGyLi80j0dG5pjow==
base64编码格式
证书公钥:
加密后数据:
base64编码格式