← 返回首页
SM2 Encryption and Decryption online , ShangMi Encryption - The X Online Tools The X

SM2 Algorithm Encryption and Decryption

SM2 (ShangMi2) is an elliptic curve cryptographic algorithm. The key generally appears in the HEX string format, but also in the PEM format. In order to facilitate interface processing, this tool will automatically convert Hex format keys to PEM format keys (sm2p256v1). If you need to restore or export the public key from the private key, you can use the ASN.1 tool to parse the PEM key. When using SM2 encryption or decryption, please pay attention to the order of the ciphertext, which is the difference between C1||C2||C3 and C1||C3||C2. C3 is a digest of coordinates and plaintext. Usually the SM3 algorithm is used. Of course, it can also be replaced with other algorithms. As long as the encryption and decryption agreements are unified. KeyId refers to the MD5 (16bits) digest value of the X coordinate of the public key. If the identity of the public and private keys is the same, it can be considered as a paired key. This tool has not been fully tested. If there are errors, please give feedback.

UTF-8 GB2312/GBK UTF-16_LE Base64 Hex
C1+C3+C2 C1+C2+C3 SM3 MD5 SHA1 SHA256 SHA384 SHA512
UTF-8 GB2312/GBK UTF-16_LE Base64 Hex Hex + Ascii Auto-detect
.NET 6 on Linux - © 2022 Shotgun - GitHub
E-Mail:abXana@the-x.cn 公众号 粤ICP备16010588号 ukulele