📖 Description
1. Why Must SM2 Be Used in Development?
With the deepening of "Xinchuang (Information Technology Application Innovation)", SM2 has become the mandatory standard for most security scenarios in China:
- Compliance Requirements: Systems in finance, power, government affairs, and electronic invoices must use national cryptographic algorithms to comply with the Multi-Level Protection Scheme (MLPS) requirements.
- Higher Security Efficiency: The 256-bit key strength of SM2 is equivalent to 3072-bit RSA, but consumes far fewer computational resources, making it more suitable for mobile and IoT devices.
- Algorithm Structure: Based on the Elliptic Curve Discrete Logarithm Problem (ECDLP), it offers extremely high resistance to attacks.
2. Core Features Analysis
This site's tool provides a one-stop SM2 processing solution, supporting the standard C1C3C2 and C1C2C3 ordering modes:
A. Key Pair Generation
- Generate Private Key and Public Key compliant with national standards with one click.
- Supports Hex and PEM format output for easy integration into code configurations.
B. Public Key Encryption
- Encrypt sensitive text using a 64-byte (uncompressed) or shorter public key.
- Mode Switching Support: Automatically adapts to different national standard implementations, supporting
C1C3C2 (new standard) and C1C2C3 (legacy standard) output formats.
C. Private Key Decryption
- Input the corresponding private key to instantly restore the encrypted ciphertext.
- Automatically recognizes Hex-encoded ciphertext packets, ensuring a smooth decryption experience.
D. Absolute Privacy Guarantee: Local Computation
- Core Security Principle: Your private key is the highest-level secret. All SM2 operations are performed entirely within your browser's frontend.
- Zero Data Upload: Your private key, plaintext, and generated key pairs are never uploaded to the server. Security is equivalent to an offline environment, completely eliminating the risk of data leakage.
3. Operation Process Overview
Step 1: Obtain Keys
- If you don't have keys yet, click "Generate SM2 Key Pair".
- Securely save the private key and share the public key.
Step 2: Public Key Encryption
- Enter the original text in the "Text to Process" box.
- Paste the received 64-byte hexadecimal public key (starting with
04) into the "Public Key" box.
- Click "SM2 Encrypt" to obtain the encrypted hexadecimal string.
Step 3: Private Key Decryption
- Paste the SM2 ciphertext represented in Hex format.
- Enter your private 32-byte hexadecimal private key.
- Click "SM2 Decrypt" to restore the original content.
4. SM2 Common Parameter Reference
| Parameter |
Description |
Example Value |
| Curve Name |
SM2 Recommended Curve (sm2p256v1) |
256-bit Elliptic Curve |
| Private Key Length |
32-byte Hexadecimal String |
7E9...A12 |
| Public Key Length |
64-byte Hexadecimal (Uncompressed) |
128-character string starting with 04... |
| Ciphertext Order |
C1(Curve Point) + C3(Hash) + C2(Ciphertext) |
Recommended by OSCCA |
5. Why Choose This National Cryptography Assistant?
- Perfect Compatibility: Strictly adheres to OSCCA standards. Test results are fully interoperable with Java
BouncyCastle, GmSSL, and mainstream national cryptography hardware gateways.
- Automatic Format Recognition: Automatically identifies whether public/private keys have
04 or 00 prefixes, reducing errors caused by format issues.
- Completely Free: No registration required, unlimited usage, providing efficient support for domestic migration projects.