GOST Encrypt
Category: Ciphers
Status: Registered and callable in the CyberChef 11.3.0 compatibility inventory.
Input / output: string → string
Background: https://wikipedia.org/wiki/GOST_(block_cipher)
What it does
The GOST block cipher (Magma), defined in the standard GOST 28147-89 (RFC 5830), is a Soviet and Russian government standard symmetric key block cipher with a block size of 64 bits. The original standard, published in 1989, did not give the cipher any name, but the most recent revision of the standard, GOST R 34.12-2015 (RFC 7801, RFC 8891), specifies that it may be referred to as Magma. The GOST hash function is based on this cipher. The new standard also specifies a new 128-bit block cipher called Kuznyechik. Developed in the 1970s, the standard had been marked ‘Top Secret’ and then downgraded to ‘Secret’ in 1990. Shortly after the dissolution of the USSR, it was declassified and it was released to the public in 1994. GOST 28147 was a Soviet alternative to the United States standard algorithm, DES. Thus, the two are very similar in structure.
Note
Status here means the operation name is implemented and callable. It does not by itself promise byte-for-byte parity for every upstream option. See Compatibility and current status for the verified scope and known boundaries.
Arguments and options
Arguments are positional. Keep their order when using bake() or
Pipeline.then().
Index |
Name |
UI type |
PyChef default |
Accepted values / format |
|---|---|---|---|---|
|
Key |
|
|
|
|
IV |
|
|
|
|
Input type |
|
|
|
|
Output type |
|
|
|
|
Algorithm |
|
|
|
|
sBox |
|
|
|
|
Block mode |
|
|
|
|
Key meshing mode |
|
|
|
|
Padding |
|
|
|
Recipe template
Important
This is a call template built from the documented defaults. Replace placeholder values such as empty keys, paths, patterns, or lookup data before running it.
from pychef import bake
input_value = "example"
args = [{'string': '', 'option': 'Hex'}, {'string': '', 'option': 'Hex'}, 'Raw', 'Hex', 'GOST 28147 (1989)', 'E-A', 'ECB', 'NO', 'PKCS5']
result = bake(input_value, [{"op": 'GOST Encrypt', "args": args}])
print(result)
Pipeline example
from pychef import Pipeline
args = [{'string': '', 'option': 'Hex'}, {'string': '', 'option': 'Hex'}, 'Raw', 'Hex', 'GOST 28147 (1989)', 'E-A', 'ECB', 'NO', 'PKCS5']
transform = Pipeline().then('GOST Encrypt', *args)
result = transform("example")
Dedicated operation module
The registered entry point lives in
pychef.operations.by_operation.gost_encrypt. Direct calls
receive the input value and a positional argument tuple:
from pychef.operations.by_operation.gost_encrypt import run
result = run("example", tuple([{'string': '', 'option': 'Hex'}, {'string': '', 'option': 'Hex'}, 'Raw', 'Hex', 'GOST 28147 (1989)', 'E-A', 'ECB', 'NO', 'PKCS5']))
- pychef.operations.by_operation.gost_encrypt.run(value, args)
Run this operation using its shared internal implementation.
- Parameters:
value (str | bytes)
args (Sequence[Any])
- Return type:
str | bytes