Multi-purpose cross-platform cryptography tool for symmetric encryption, cipher-based message authentication code (CMAC), recursive hash digest, hash-based message authentication code (HMAC), digital signature, shared key agreement (VKO) and PBKDF2 function for embedded systems.
GOST refers to a set of technical standards maintained by the Euro-Asian Council for Standardization, Metrology and Certification (EASC), a regional standards organization operating under the auspices of the Commonwealth of Independent States (CIS).
- GOST 28147-89 64-bit block cipher (RFC 5830)
- GOST R 34.11-94 hash function 256-bit (RFC 5831)
- GOST R 50739-95 data sanitization method (non-cryptographic)
- GOST R 34.10-2001 public key signature function (RFC 5832)
- VKO GOST R 34.10-2001 key agreement function (RFC 4357)
- GOST R 34.10-2012 public key signature function (RFC 7091)
- VKO GOST R 34.10-2012 key agreement function (RFC 7836)
- GOST R 34.11-2012 Π‘ΡΡΠΈΠ±ΠΎΠ³ (Streebog) hash function 256/512-bit (RFC 6986)
- GOST R 34.12-2015 128-bit block cipher ΠΡΠ·Π½Π΅ΡΠΈΠΊ (Kuznechik) (RFC 7801)
- GOST R 34.12-2015 64-bit block cipher ΠΠ°Π³ΠΌΠ° (Magma) (RFC 8891)
- MGM AEAD mode for 64 and 128 bit ciphers (RFC 9058)
-
Block Ciphers:
- GOST 28147-89 CryptoPro
- GOST R 34.12-2015 Magma (default)
- GOST R 34.12-2015 Kuznechik (Grasshopper)
-
Supported ParamSets:
- GOST 28147-89 CryptoPro: A, B, C, D, EAC, Z
-
Modes of Operation:
- MGM: Multilinear Galois Mode (AEAD)
- CTR: Counter Mode (a.k.a. CNT)
- OFB: Output Feedback Mode
- CFB8: Cipher Feedback Mode (8-bit)
-
Message Digest Algorithms:
- GOST R 34.11-94 CryptoPro 256-bit
- GOST R 34.11-2012 Streebog 256/512-bit (default)
-
Public key Algorithms:
- GOST R 34.10-2001 CryptoPro 256-bit
- GOST R 34.10-2012 256/512-bit (default)
-
Supported ParamSets:
- GOST R 34.10-2001 256-bit: A, B, C, XA, XB
- GOST R 34.10-2012 256-bit: A, B, C, D
- GOST R 34.10-2012 512-bit: A, B, C
-
Cryptographic Functions:
- Symmetric Encryption + AEAD Mode
- Digital Signature (ECDSA equivalent)
- VKO (Π²ΡΡΠ°Π±ΠΎΡΠΊΠ° ΠΊΠ»ΡΡΠ° ΠΎΠ±ΡΠ΅Π³ΠΎ) shared key negociation (ECDH equivalent)
- Recursive Hash Digest + Check
- CMAC (Cipher-based message authentication code)
- HMAC (Hash-based message authentication code)
- HKDF (HMAC-based key derivation function)
- PBKDF2 (Password-based key derivation function 2)
- TLS 1.2 (Transport Layer Security)
-
Non-Cryptographic Functions:
- GOST R 50739-95 data sanitization method
- Bin to Hex/Hex to Bin string conversion
- Random Art (Public key Fingerprint)
- TLS 1.3
- MGM Mode of operation
- OFB Mode of operation
- PBKDF2 Function
- GOST 28147-89 CMAC
- GOST 28147-89 symmetric cipher
- GOST R 34.11-94 HMAC
- GOST R 50739-95 data sanitization method
- GOST R 34.10-2001 public key signature function
- VKO GOST R 34.10-2001 key agreement function
- GOST R 34.12-2015 Magma symmetric cipher
-128 Block size: 64 or 128. (for symmetric encryption only) (default 64) -512 Bit length: 256 or 512. (default 256) -check string Check hashsum file. ('-' for STDIN) -crypt string Encrypt/Decrypt with symmetric ciphers. -digest string File/Wildcard to generate hashsum list. ('-' for STDIN) -hex string Encode binary string to hex format and vice-versa. -hkdf int HMAC-based key derivation function with a given output bit length. -info string Associated data, additional info. (for HKDF and AEAD encryption) -iter int Iterations. (for SHRED and PBKDF2 only) (default 1) -iv string Initialization vector. (for non-AEAD symmetric encryption) -key string Private/Public key, password or HMAC key, depending on operation. -mac string Compute hash-based/cipher-based message authentication code. -mode string Mode of operation: MGM, CTR or OFB. (default "MGM") -old Use old roll of algorithms. -paramset string Elliptic curve ParamSet: A, B, C, D, XA, XB. (default "A") -pbkdf2 Password-based key derivation function 2. -pkey string Generate keypair, Derive shared secret, Sign and Verify. -pub string Remote's side public key. -rand int Generate random cryptographic key with a given output bit length. -recursive Process directories recursively. (for DIGEST command only) -salt string Salt. (for PBKDF2 and HKDF commands) -shred string Files/Path/Wildcard to apply data sanitization method. -signature string Input signature. (verification only) -version Print version information.
./gosttk -pkey generate -old [-paramset A|B|C|XA|XB]
./gosttk -pkey gen [-paramset A|B|C|D] [-512 -paramset A|B|C]
./gosttk -pkey sign [-512|-old] -key $prvkey < file.ext > sign.txt
sign=$(cat sign.txt)
./gosttk -pkey verify [-512|-old] -key $pubkey -signature $sign < file.ext
echo $?
./gosttk -pkey derive [-512|-old] -key $prvkey -pub $pubkey
./gosttk -crypt enc -key $shared < plaintext.ext > ciphertext.ext
./gosttk -crypt dec -key $shared < ciphertext.ext > plaintext.ext
./gosttk -crypt enc -128 -key $shared < plaintext.ext > ciphertext.ext
./gosttk -crypt dec -128 -key $shared < ciphertext.ext > plaintext.ext
./gosttk -crypt enc -old -key $shared < plaintext.ext > ciphertext.ext
./gosttk -crypt dec -old -key $shared < ciphertext.ext > plaintext.ext
./gosttk -mac cmac -128 -key $128bitkey < file.ext
./gosttk -mac cmac -128 -key $128bitkey -signature $128bitmac < file.ext
./gosttk -mac cmac [-old] -key $128bitkey < file.ext
./gosttk -mac cmac [-old] -key $128bitkey -signature $64bitmac < file.ext
./gosttk -digest "*.*" -old [-recursive]
./gosttk -digest - -old < file.ext
./gosttk -mac hmac -old -key $256bitkey < file.ext
./gosttk -mac hmac -old -key $256bitkey -signature $256bitmac < file.ext
./gosttk -digest - [-512] < file.ext
./gosttk -mac hmac [-512] -key $256bitkey < file.ext
./gosttk -mac hmac [-512] -key $256bitkey -signature $256bitmac < file.ext
./gosttk -hkdf 256 [-512|-old] -key "IKM" -info "AD" -salt "salt"
./gosttk -pbkdf2 [-512|-old] -key "pass" -iter 10000 -salt "salt"
PBKDF2 function can be combined with the CRYPT, HMAC commands:
./gosttk -crypt enc -128 -pbkdf2 -512 -key "pass" < plaintext.ext > ciphertext.ext
./gosttk -mac hmac [-512] -pbkdf2 -key "pass" -salt "salt" -iter 10000 < file.ext
./gosttk -shred "keypair.ini" -iter 25
./gosttk -hex enc < File.ext > File.hex
./gosttk -hex dec < File.hex > File.ext
./gosttk -hex dump < File.ext
./gosttk -key $pubkey
./gosttk -key - < Pubkey.txt
Cross-platform hybrid cryptography tool for shared key agreement (VKO), digital signature and TLS 1.2 for small or embedded systems. This tool is similar to the main tool, with the difference that the keys are used in PEM format, which allows the encryption of the private key and the generation of certificates necessary for the TLS protocol.
- GOST R 34.10-2012 public key signature function (RFC 7091)
- VKO GOST R 34.10-2012 key agreement function (RFC 7836)
- GOST R 34.11-2012 Streebog hash function 256/512-bit (RFC 6986)
- GOST R 34.12-2015 128-bit block cipher Kuznechik (RFC 7801)
- GOST R 34.10-2012 256-bit: A, B, C, D
- GOST R 34.10-2012 512-bit: A, B
Cryptographic Functions:
- Digital Signature (ECDSA-like)
- VKO Shared Key Agreement (ECDH)
- TLS 1.2 (Transport Layer Security)
Non-cryptographic Functions:
- Privacy-Enhanced Mail (PEM format)
- RandomArt (OpenSSH-like)
-512 Key length: 256 or 512. (default 256) -cert string Certificate name. (default "Certificate.pem") -ipport string Local Port/remote's side Public IP:Port. -key string Private/Public key, depending on operation. -paramset string Elliptic curve ParamSet: A, B, C, D. (default "A") -pkey string Generate keypair, Generate certificate. [keygen|certgen] -private string Private key path. (for keypair generation) (default "Private.pem") -public string Public key path. (for keypair generation) (default "Public.pem") -pwd string Password. (for Private key PEM encryption) -signature string Input signature. (verification only) -tcp string Encrypted TCP/IP Transfer Protocol. [server|ip|client]
./gostls -pkey keygen [-512] [-paramset B] [-pwd "pass"]
./gostls -pkey [text|modulus] [-pwd "pass"] -key private.pem
./gostls -pkey [text|modulus] -key public.pem
./gostls -pkey randomart -key public.pem
./gostls -pkey sign -key private.pem [-pwd "pass"] < file.ext > sign.txt
sign=$(cat sign.txt|awk '{print $2}')
./gostls -pkey verify -key public.pem -signature $sign < file.ext
echo $?
./gostls -pkey derive -key private.pem -public peerkey.pem
./gostls -pkey certgen -key private.pem [-pwd "pass"] [-cert "output.ext"]
./gostls -pkey [text|modulus] -cert certificate.pem
./gostls -tcp ip > PubIP.txt
./gostls -tcp server -cert certificate.pem -key private.pem [-ipport "8081"]
./gostls -tcp client -cert certificate.pem -key private.pem [-ipport "127.0.0.1:8081"]
This project is licensed under the ISC License.