K019 / Symmetric ciphers (block and stream)
Kuznyechik
A 128-bit block cipher defined by Russian national standard GOST R 34.12-2015 (RFC 7801).
CRYPTOGRAPHY LAB / K019
Cryptography Lab · Kuznyechik
Run real computations and inspect intermediate states step by step.
Educational only. Never enter real passwords or secret keys. Computation stays in your browser; input and trace values are not sent to a server. Do not use this implementation in production.
Kuznyechik (GOST R 34.12-2015)
See the scope above for fixed examples, reduced parameters and supported variants. Standard operation names and formulas are retained.Output
Previous state
- Definition and overview
- A 128-bit block cipher defined by Russian national standard GOST R 34.12-2015 (RFC 7801). Source document ↗
- Classification and reversibility
- A block cipher supporting both encryption and decryption. Source document ↗
- Key or secret requirements
- Requires a 32-byte (256-bit) secret key. Source document ↗
- Operating principle and structure
- An SPN (substitution-permutation network) with a Feistel-network key schedule. Source document ↗
- Key size, block size and parameters
- 128-bit block, 256-bit key, 10 rounds. Source document ↗
- Security strength and recommendation
- Security strength is presented as 256 bits for a 256-bit key; the best published attack is a five-round MITM attack (about 2^140), which is impractical. Source document ↗
- Known attacks and vulnerabilities
- Reduced-round (5/9) MITM attacks and hidden S-box structure issues are known, but do not constitute a full-cipher break. Source document ↗
- Standards and certification
- Russian national standard GOST R 34.12-2015, published in RFC 7801. Source document ↗
- Typical uses
- Used in MGM cryptographic transforms for IPsec ESP/IKEv2. Source document ↗
- Implementations, libraries and tools
- Go gostcrypto provides KuznyechikEncrypt/Decrypt APIs. Source document ↗
- Decryption or decoding
- Decrypt with the same key through KuznyechikDecrypt. Source document ↗
- Advantages
- The Go implementation has no dependencies beyond the standard library and needs no cgo. Source document ↗
- Limitations and cautions
- Default implementation uses tables and is not constant-time; beware side channels. Source document ↗
- Distinguishing encryption, encoding and hashing
- Streebog-256 is a hash; Kuznyechik is a block cipher for encryption/decryption. Source document ↗
Practical examples
Example
Prepare 16 bytes of plaintext and a 32-byte key, encrypt with Kuznyechik to produce a 16-byte ciphertext, then decrypt with the same key. Actual keys and secrets are not shown.
Procedure
Encryption: generate/store a 32-byte key, choose a vetted operating mode and IV/nonce/tag policy, encrypt through the mode API. Decrypt with the same key and required IV/nonce/tag, verifying the integrity tag. Base64 is a separate keyless representation conversion.
Scenario
Use where GOST interoperability is required, such as IPsec ESP/IKEv2 (MGM) or VeraCrypt volume compatibility. Use higher-level modes from vetted libraries and securely manage keys, IVs and tags.
Pitfalls and alternatives
Avoid direct ECB, IV/nonce reuse, hardcoded keys, direct low-level block APIs, side channels in table-based implementations and confusing encryption with Base64 or hashing. Use authenticated modes and secure key management.
References
- kuznyechik/DESIGN.md ↗
- README.rst ↗
- go-encryptions/kuznyechik ↗
- Kuznyechik ↗
- Kuznyechik (block cipher) · Encryption Codex ↗
- Kuznyechik — secure-crypto.org ↗
- RFC 9227: Using GOST Ciphers in the Encapsulating Security Payload (ESP) and Internet Key Exchange Version 2 (IKEv2) Protocols | RFC Editor ↗
- github.com/tarantool/go-gostcrypto ↗