# guanzhi/gmssl

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/guanzhi-gmssl).**

6,075 stars · 1,824 forks · C · Apache-2.0

## Links

- GitHub: https://github.com/guanzhi/GmSSL
- Homepage: http://gmssl.org
- awesome-repositories: https://awesome-repositories.com/repository/guanzhi-gmssl.md

## Topics

`crypto` `encryption` `pairing` `post-quantum` `sm2` `sm3` `sm4` `sm9` `ssl` `tlcp` `tls` `zuc`

## Description

GmSSL is an open-source cryptographic library that implements the Chinese national cryptographic standards SM2, SM3, SM4, SM9, and ZUC as a unified algorithm suite. It provides a comprehensive set of cryptographic primitives including symmetric and asymmetric encryption, digital signatures, hashing, and key exchange, all built around these national standards for government and enterprise security applications.

The library distinguishes itself through several integration capabilities. It includes an OpenSSL compatibility layer that maps GmSSL functions to OpenSSL API calls, enabling drop-in replacement in applications like Nginx. A hardware abstraction layer provides software interfaces to SDF and SKF cryptographic devices, allowing transparent offloading of operations to PCI-E cards or USB tokens. Multi-language JNI bindings expose the cryptographic APIs to Java, PHP, and Go applications through a compiled shared library.

The library supports a full TLS and TLCP protocol stack with TLS 1.2, 1.3, and TLCP 1.1 using SM-series cipher suites, along with an X.509 certificate engine for creating, parsing, validating, and managing digital certificates and PKI requests. It also includes post-quantum cryptography support with CRYSTALS-Kyber, SPHINCS+, XMSS, and LMS/HSS algorithms. The cross-platform build system compiles for Android/ARM via NDK and Windows via Visual Studio, producing CLI binaries and shared libraries.

## Tags

### Security & Cryptography

- [Chinese National Standard](https://awesome-repositories.com/f/security-cryptography/asymmetric-signing/cryptographic-signing-methods/algorithm-suites/chinese-national-standard.md) — Implements Chinese national cryptographic standards SM2, SM3, SM4, SM9, and ZUC as a unified algorithm suite.
- [Dual Symmetric and Asymmetric Support](https://awesome-repositories.com/f/security-cryptography/asymmetric-signing/symmetric-signing/dual-symmetric-and-asymmetric-support.md) — Provides SM4, AES, SM2, SM9, and RSA encryption, signing, key exchange, and hashing via a unified API.
- [Chinese National Standard Cryptographic Implementations](https://awesome-repositories.com/f/security-cryptography/chinese-national-standard-cryptographic-implementations.md) — Implements Chinese national cryptographic standards SM2, SM3, SM4, SM9, and ZUC for encryption, signing, and hashing.
- [Chinese National Standard Cryptographic Libraries](https://awesome-repositories.com/f/security-cryptography/chinese-national-standard-cryptographic-libraries.md) — An open-source cryptographic library implementing Chinese national standards SM2, SM3, SM4, SM9, and ZUC for encryption, signing, and secure communication.
- [Cryptographic Digests](https://awesome-repositories.com/f/security-cryptography/cryptographic-digests.md) — Hashes arbitrary input data into fixed-size digests using SHA-256 and other algorithms for integrity. ([source](http://gmssl.org/docs/evp-api.html))
- [SM3 Hash Implementations](https://awesome-repositories.com/f/security-cryptography/cryptographic-hash-generation/sm3-hash-implementations.md) — Ships a dedicated library implementing the SM3 hash algorithm for data integrity verification and digital signatures.
- [SM3 Integrity Hashes](https://awesome-repositories.com/f/security-cryptography/cryptographic-hash-generation/sm3-integrity-hashes.md) — Generates fixed-length hash values using the SM3 cryptographic hash algorithm for data integrity verification. ([source](http://gmssl.org/docs/docindex.html))
- [Cryptographic Key Generation](https://awesome-repositories.com/f/security-cryptography/cryptographic-key-management/cryptographic-key-generation.md) — Derive symmetric keys from passwords using PBKDF2 or HKDF and produce random bytes via a DRBG. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))
- [Digital Message Signing](https://awesome-repositories.com/f/security-cryptography/digital-message-signing.md) — Create and validate digital signatures or MACs over message data using symmetric keys or asymmetric key pairs. ([source](http://gmssl.org/docs/evp-api.html))
- [Digital Signatures](https://awesome-repositories.com/f/security-cryptography/digital-signatures.md) — Implements digital signature creation and verification using SM2 and RSA algorithms. ([source](http://gmssl.org/docs/java-api.html))
- [SM2](https://awesome-repositories.com/f/security-cryptography/digital-signatures/sm2.md) — Ships a dedicated implementation of SM2 digital signatures for government and enterprise use. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))
- [SM2 and SM9](https://awesome-repositories.com/f/security-cryptography/digital-signatures/sm2-and-sm9.md) — Provides both SM2 and SM9 digital signature algorithms for identity-based and certificate-based signing. ([source](http://gmssl.org/docs/docindex.html))
- [Asymmetric Encryption](https://awesome-repositories.com/f/security-cryptography/encryption-key-management/asymmetric-encryption.md) — Encrypts data with a recipient's public key and decrypts it with the corresponding private key for secure asymmetric communication. ([source](http://gmssl.org/docs/java-api.html))
- [Diffie-Hellman Exchanges](https://awesome-repositories.com/f/security-cryptography/key-exchange-protocols/diffie-hellman-exchanges.md) — Combine a private key with a peer's public key using DH or ECDH to produce a shared secret for symmetric encryption. ([source](http://gmssl.org/docs/evp-api.html))
- [Shared Secret Derivations](https://awesome-repositories.com/f/security-cryptography/key-exchange-protocols/shared-secret-derivations.md) — Perform a key exchange protocol to produce a shared secret between two parties over an insecure channel. ([source](http://gmssl.org/docs/java-api.html))
- [National Standard Secure Communication Implementations](https://awesome-repositories.com/f/security-cryptography/national-standard-secure-communication-implementations.md) — Implements Chinese national cryptographic standards SM2, SM3, SM4, SM9, and ZUC for encrypted communication and digital signatures. ([source](http://gmssl.org/docs/ipsecvpn.html))
- [TLS Implementations](https://awesome-repositories.com/f/security-cryptography/national-standard-secure-communication-implementations/tls-implementations.md) — Secures network communications by implementing SSL/TLS protocols with Chinese national standard cipher suites. ([source](http://gmssl.org/docs/commands.html))
- [General-Purpose Hashing](https://awesome-repositories.com/f/security-cryptography/password-hash-recovery/gpu-accelerated-recovery/general-purpose-hashing.md) — Computes hash digests using SM3, SHA-256, and MD5 for data integrity and authentication. ([source](http://gmssl.org/docs/commands.html))
- [Integrity Verifications](https://awesome-repositories.com/f/security-cryptography/security/cryptography-and-secrets/cryptographic-primitives-management/cryptographic-hash-computations/data-integrity-identifiers/integrity-verifications.md) — Produces fixed-size fingerprints using SM3, SHA-1, and SHA-2 for data integrity verification. ([source](http://gmssl.org/docs/java-api.html))
- [SM3 Hash Computations](https://awesome-repositories.com/f/security-cryptography/security/cryptography-and-secrets/cryptographic-primitives-management/cryptographic-hash-computations/sm3-hash-computations.md) — Computes cryptographic hashes of input data using the SM3 algorithm, producing a fixed-size digest. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))
- [Key Pair Generations](https://awesome-repositories.com/f/security-cryptography/ssh-key-management/key-pair-generations.md) — Create public/private key pairs for algorithms like EC, DSA, and DH, supporting operations such as signing and key agreement. ([source](http://gmssl.org/docs/evp-api.html))
- [General TLS Connection Establishment](https://awesome-repositories.com/f/security-cryptography/ssl-tls-connection-security/mqtt-tls-encryption/smtp-tls-encryption/general-tls-connection-establishment.md) — Negotiate encrypted communication channels using SSL/TLS protocols. ([source](http://gmssl.org/docs/docindex.html))
- [SM4 Implementations](https://awesome-repositories.com/f/security-cryptography/symmetric-cipher-implementations/sm4-implementations.md) — A symmetric encryption library supporting SM4 in multiple modes including CBC, CTR, GCM, and XTS for data confidentiality.
- [Symmetric Encryption](https://awesome-repositories.com/f/security-cryptography/symmetric-encryption.md) — Protect data using a shared key and initialization vector with algorithms like AES in CBC mode, applying PKCS padding by default. ([source](http://gmssl.org/docs/evp-api.html))
- [Hybrid Encryption Schemes](https://awesome-repositories.com/f/security-cryptography/symmetric-encryption/hybrid-encryption-schemes.md) — Performs encryption and decryption using Chinese national standard cryptographic algorithms SM2 and SM4. ([source](http://gmssl.org/docs/docindex.html))
- [Authenticated Encryption](https://awesome-repositories.com/f/security-cryptography/authenticated-encryption.md) — Provides both confidentiality and integrity by encrypting data and appending a MAC tag with optional associated data. ([source](http://gmssl.org/docs/evp-api.html))
- [Certificate Lifecycle Management](https://awesome-repositories.com/f/security-cryptography/certificate-lifecycle-management.md) — Creates, parses, and validates X.509 digital certificates, certificate revocation lists, and certificate signing requests. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))
- [Boneh-Boyen Identity-Based Encryptions](https://awesome-repositories.com/f/security-cryptography/client-side-encryption/identity-management/boneh-boyen-identity-based-encryptions.md) — Uses the Boneh-Boyen IBE scheme to encrypt data so only a recipient with a specific identity can decrypt it. ([source](http://gmssl.org/docs/bb1ibe.html))
- [Hardware Key Storage](https://awesome-repositories.com/f/security-cryptography/cryptographic-key-management/external-key-integration/hardware-key-importations/webauthn-hardware-key-authentications/hardware-security-key-authentications/hardware-key-storage.md) — Keeps private keys inside USB keys, PCI cards, or cryptographic devices so they never leave secure hardware. ([source](http://gmssl.org/docs/crypto-devices.html))
- [SDF and SKF Abstraction Layers](https://awesome-repositories.com/f/security-cryptography/cryptographic-provider-interfaces/sdf-and-skf-abstraction-layers.md) — Provides a software abstraction layer for SDF and SKF cryptographic hardware accelerators and secure key storage.
- [SM2 Hardware Signing](https://awesome-repositories.com/f/security-cryptography/cryptographic-signature-verification/external-key-verifiers/hardware-key-signature-verification/hardware-key-signing/sm2-hardware-signing.md) — Performs SM2 signing inside a cryptographic device using a private key that cannot be exported. ([source](http://gmssl.org/docs/crypto-devices.html))
- [National Standard Hardware Accelerators](https://awesome-repositories.com/f/security-cryptography/elliptic-curve-cryptography/hardware-accelerated-operations/national-standard-hardware-accelerators.md) — Offloads SM1 and SSF33 cipher computations to dedicated hardware devices to reduce CPU load. ([source](http://gmssl.org/docs/crypto-devices.html))
- [Hardware Security Module Integrations](https://awesome-repositories.com/f/security-cryptography/hardware-security-module-integrations.md) — Interacts with Chinese national standard SKF and SDF cryptographic hardware devices for secure key operations. ([source](http://gmssl.org/docs/docindex.html))
- [X.509 Certificate Parsing and Validation](https://awesome-repositories.com/f/security-cryptography/identity-access-management/identity-management/server-authenticity-verification/certificate-based-authentication/x-509-certificate-parsing-and-validation.md) — Creates, parses, validates, and manages digital certificates, CRLs, and PKI requests with full lifecycle support.
- [Message Authentication Codes](https://awesome-repositories.com/f/security-cryptography/message-authentication-codes.md) — Generate and verify a keyed hash to authenticate a message and detect tampering. ([source](http://gmssl.org/docs/java-api.html))
- [Key Derivation Functions](https://awesome-repositories.com/f/security-cryptography/password-management/key-derivation-functions.md) — Generates secret keys from a password or shared secret using PBKDF2 or HKDF key derivation functions. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))
- [Post-Quantum Algorithm Executions](https://awesome-repositories.com/f/security-cryptography/post-quantum-cryptography/post-quantum-algorithm-executions.md) — Performs key encapsulation and hash-based signing using CRYSTALS-Kyber, SPHINCS+, XMSS, and LMS/HSS algorithms. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))

### Part of an Awesome List

- [SM4 Cipher Modes](https://awesome-repositories.com/f/awesome-lists/security/file-encryption/block-level-encryption/cipher-block-modes/sm4-cipher-modes.md) — Encrypts and decrypts data using the SM4 block cipher in multiple modes including CBC, CTR, GCM, and XTS. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))
- [OpenSSL Compatibility Layers](https://awesome-repositories.com/f/awesome-lists/security/file-encryption/openssl-based/openssl-compatibility-layers.md) — Replacing OpenSSL with GmSSL's cryptographic functions in existing applications like Nginx using a compatibility layer.
- [SM2 and SM9 Public-Key Cryptography Libraries](https://awesome-repositories.com/f/awesome-lists/security/public-key-cryptography/sm2-and-sm9-public-key-cryptography-libraries.md) — Provides SM2 elliptic curve and SM9 identity-based public-key encryption, digital signatures, and key exchange.
- [Hardware Security Module Lifecycles](https://awesome-repositories.com/f/awesome-lists/security/identity-and-access-management/cryptographic-key-management/hardware-security-module-lifecycles.md) — Generate, store, and manage cryptographic keys through hardware security modules or key management services. ([source](http://gmssl.org/docs/docindex.html))

### Programming Languages & Runtimes

- [TLS and TLCP Protocol Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/tls-implementations/tls-1-3-protocol-implementations/tls-and-tlcp-protocol-implementations.md) — Supports TLS 1.2, 1.3, and TLCP 1.1 with SM-series cipher suites for secure network communication.
- [Multi-Language Bindings](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/foreign-function-interfaces/native-library-integrations/c-library-bindings/multi-language-bindings.md) — Integrating cryptographic functions into applications via API bindings for Java, PHP, and Go.

### Data & Databases

- [X.509 Certificate Parsers](https://awesome-repositories.com/f/data-databases/data-serialization-and-parsing/x-509-certificate-parsers.md) — Creates, signs, verifies, and manages X.509 certificates, CRLs, and PKI requests. ([source](http://gmssl.org/docs/commands.html))

### Hardware & IoT

- [SDF and SKF Device Interfaces](https://awesome-repositories.com/f/hardware-iot/card-emulation/card-cryptographic-verification/sdf-and-skf-device-interfaces.md) — Interfaces with SDF and SKF cryptographic hardware devices such as PCI-E cards and USB tokens. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))
- [National Standard Crypto Device Communication](https://awesome-repositories.com/f/hardware-iot/connectivity-iot/hardware-communication/national-standard-crypto-device-communication.md) — Communicates with Chinese national standard SDF and SKF cryptographic hardware devices such as PCI-E cards and USB tokens. ([source](https://cdn.jsdelivr.net/gh/guanzhi/gmssl@master/README.md))
- [Hardware Abstraction Layers](https://awesome-repositories.com/f/hardware-iot/hardware-abstraction-layers.md) — Provides a software interface to SDF and SKF cryptographic devices, offloading operations to PCI-E cards or USB tokens.
- [National Standard Crypto Hardware Interfaces](https://awesome-repositories.com/f/hardware-iot/hardware-interface-standardizations/national-standard-crypto-hardware-interfaces.md) — Accesses national-standard SDF and SKF cryptographic hardware accelerators through a software abstraction layer. ([source](http://gmssl.org/docs/docindex.html))

### Networking & Communication

- [PKCS and CMS Message Processors](https://awesome-repositories.com/f/networking-communication/message-encoders-and-decoders/pkcs-and-cms-message-processors.md) — Encode, decode, and transform PKCS and CMS structured messages. ([source](http://gmssl.org/docs/commands.html))
