Russian cryptography standards
Recently I was working on a small project where I had to implement (well, to use an implementation, of course) digital signature by a Russian GOST standard. The specs where somewhat messy, referring outdated standards or for example mentioning digital signature standards where they were talking about encryption. So I had to do a little research about what crypto standards exist in Russia and how one can use them. I’m going to share this information with you in this post.
Basically, there are four groups of Russian crypto standards that are interesting for us:
- Digital signature standards
- Cryptographic hash function standards
- Block ciphers standards
- Block cipher modes of operation standards
For each of this standard groups I present the basic information about it and its commonly known Western/American counterpart(s).
1. Digital signature standards: GOST 34.10-*
This is a Russian standard for digital signatures. It describes an elliptic curve digital signature algorithm that must be used if you’re going to sign some official documents in Russia.
The most recent standard is GOST 34.10–2018. This is an international/regional standard (valid also for some CIS/EAEU countries). It is based on an older Russian national GOST 34.10–2012 standard. An older version that also was widely used is GOST 34.10–2001 (2004 for the international version), but now it’s deprecated.
American analog: probably it’s FIPS 186–* (FIPS 186–4 is the latest, see Digital Signature Standard)
2. Cryptographic hash function standards: GOST 34.11-*
The most recent standard is GOST 34.11–2018 (2012 for the national version on which it is based) describes a hash function named Streebog (Stribog). The older standard GOST 34.11–94 describes another hash function, it’s not used since 2013.
An interesting fact: the cipher is (unofficially) named after the Slavic god of the winds, sky and air Stribog. The standard text contains an example that uses as a sample string a quotation from “The Tale of Igor’s Campaign”, an old Russian epic poem. And that quotation mentions the deity.
American analogs: MD5, SHA-1/2/3
3. Block ciphers standards: GOST 34.12-*
This standard describes encryption algorithms for fixed size data blocks. The current version of standard is GOST 34.12–2018 (based on the 2015 national standard) describes two such algorithms: Kuznyechik (from Russian: “grasshopper”) and Magma.
The Kuznyechik cipher is the newest from the two. It’s used to encrypt 128 bit blocks with a 256 bit key. It is based on a mathematical structure called Substitution–permutation network. There are several other block ciphers using the same basic construct, the most popular of them is AES.
The Magma cipher is the older one, it was originally developed in 1970s and published as a standard in 1989 in GOST 28147–89. It encrypts 64 bit blocks with a 256 bit key. It is a Feistel network-based cipher similar to DES.
American analogs: DES, AES
4. Block cipher modes of operation standards: GOST 34.13-*
The current version of the standard is GOST 34.13–2018 (or 2015 for the national version).
The standard describes how to apply block ciphers like Kuznyechik or Magma to data of any size. Six modes of operation are included in the standard:
- ECB (Electronic Codebook)
- CTR (Counter)
- OFB (Output Feedback)
- CBC (Cipher Block Chaining)
- CFB (Cipher Feedback)
- MAC (as I understand, it’s an authenticated encryption mode using CMAC/OMAC1)
As you can see, mostly those are well known modes, so nothing very special or exotic here. Other details like padding algorithm and initialization vector generation are also included in this standard.
American analogs: it’s basically the same ECB, CBC etc. modes, see here.
Sometimes the best way to explain what a thing does is to name a known analog. That’s what I did here for Russian crypto standards, naming well-known Western counterparts for every algorithm/function mentioned above. I hope it will be helpful for those who start to get acquainted with Russian cryptography.