Block ciphers

Magma

The Soviet-era 64-bit Feistel cipher retained in GOST R 34.12-2015

standard Safe API

About Magma

Magma is a block cipher from the Magma (GOST 28147-89) family. It uses a 32-byte (256-bit) key and an 8-byte (64-bit) block. Its registry entry cites GOST R 34.12-2015 and RFC 8891. NextSSL lists it in the standard tier and exposes it through the safe API.

Overview

Magma is the 64-bit block cipher originally standardised in the USSR as GOST 28147-89 and retained under the name Magma in GOST R 34.12-2015, documented in RFC 8891. It has a 256-bit key and very small S-boxes.

Magma is a 32-round Feistel network. The round function adds a 32-bit subkey modulo 2^32, applies eight 4-bit S-boxes and rotates the result left by 11 bits. The 256-bit key is split into eight 32-bit words used in a fixed order. In GOST 28147-89 the S-boxes were unspecified parameters; GOST R 34.12-2015 fixes one set.

Magma is used in Russian government and banking systems and in GOST TLS cipher suites. The 2015 standard renamed the cipher and fixed its S-boxes to a single set defined by the Russian standardisation technical committee TC 26. Its 64-bit block means that no more than a few gigabytes should be encrypted under a single key, since block collisions become likely around 2^32 blocks.

History

1989–2015
  1. Magma published

  2. Specified in GOST R 34.12-2015

Security notes

Academic attacks on the full cipher exist with very high complexity, including attacks in the multi-key and reflection settings, but none are practical. Its 64-bit block limits safe data volume per key.

Typical uses

Russian GOST complianceLegacy GOST 28147-89 data

Sizes

FieldBytesMeaning
key32Secret key
block8Block

Use it

from nextssl_demo import NextSSL

ns = NextSSL()              # safe API: safe and standard tiers
block = ns.call("blockcipher_encrypt", "magma", None, key, plaintext_block)[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Similar names

Looking for something else?

Frequently asked questions

What is Magma?

Magma is a block cipher in the Magma (GOST 28147-89) family. Magma is the 64-bit block cipher originally standardised in the USSR as GOST 28147-89 and retained under the name Magma in GOST R 34.12-2015, documented in RFC 8891.

What are the Magma sizes?

In NextSSL, Magma uses: key 32 bytes, block 8 bytes.

Who designed Magma and when?

Magma belongs to the Magma (GOST 28147-89) family, first published in 1989. Its origin: GOST 28147-89; GOST R 34.12-2015; RFC 8891.

Which standards define Magma?

Magma is referenced by GOST R 34.12-2015, RFC 8891.

Is Magma safe to use?

Magma is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.