GOST Hash

Category: Hashing

Status: Registered and callable in the CyberChef 11.3.0 compatibility inventory.

Input / output: ArrayBuffer → string

Background: https://wikipedia.org/wiki/GOST_(hash_function)

What it does

The GOST hash function, defined in the standards GOST R 34.11-94 and GOST 34.311-95 is a 256-bit cryptographic hash function. It was initially defined in the Russian national standard GOST R 34.11-94 Information Technology – Cryptographic Information Security – Hash Function. The equivalent standard used by other member-states of the CIS is GOST 34.311-95. This function must not be confused with a different Streebog hash function, which is defined in the new revision of the standard GOST R 34.11-2012. The GOST hash function is based on the GOST block cipher.

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

0

Algorithm

argSelector

'GOST 28147 (1994)'

'GOST 28147 (1994)', 'GOST R 34.11 (Streebog, 2012)'

1

Digest length

option

'256'

'256', '512'

2

sBox

option

'D-A'

'E-TEST', 'E-A', 'E-B', 'E-C', 'E-D', 'E-SC', 'E-Z', 'D-TEST', 'D-A', 'D-SC'

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 = b"example"
args = ['GOST 28147 (1994)', '256', 'D-A']
result = bake(input_value, [{"op": 'GOST Hash', "args": args}])
print(result)

Pipeline example

from pychef import Pipeline

args = ['GOST 28147 (1994)', '256', 'D-A']
transform = Pipeline().then('GOST Hash', *args)
result = transform(b"example")

Direct call

pychef.ops.run_operation runs any registered operation as a plain function, under the active ExecutionPolicy (safe defaults, no network):

from pychef.ops import run_operation

args = ['GOST 28147 (1994)', '256', 'D-A']
result = run_operation('GOST Hash', b"example", args=args)

Common operations also have typed helpers in Direct operations.

Low-level operation module

Warning

The module below is an internal implementation detail. It applies no execution policy, resource limits, or error sanitization; prefer bake(), Pipeline, or pychef.ops for application code.

The registered entry point lives in pychef.operations.by_operation.gost_hash. Direct calls receive the input value and a positional argument tuple:

from pychef.operations.by_operation.gost_hash import run

result = run(b"example", tuple(['GOST 28147 (1994)', '256', 'D-A']))
pychef.operations.by_operation.gost_hash.run(value, args)

Run this operation using its shared internal implementation.

Parameters:
  • value (str | bytes)

  • args (Sequence[Any])

Return type:

str | bytes