Multi-purpose cross-platform hybrid cryptography tool for symmetric and asymmetric encryption, cipher-based message authentication code (CMAC/GMAC/PMAC), recursive hash digest, hash-based message authentication code (HMAC), HMAC-based key derivation function (HKDF), password-based key derivation function (PBKDF2/Scrypt/Argon2), password-hashing scheme (Bcrypt/Argon2/Makwa), shared key agreement (ECDH/VKO/X25519), digital signature (RSA/ECDSA/EdDSA/GOST/SPHINCS+), X.509 CSRs, CRLs and Certificates, and TCP instant server with TLS 1.3 and TLCP encryption layers for small or embedded systems.
Both Whirlpool and GOST R 34.11-2012 (Streebog) uses Miyaguchi–Preneel construction.Anubis Involutional SPN 128-bit block cipher (Barreto, ESAT/COSIC) BSI TR-03111 Elliptic Curve Cryptography (ECC) Technical Guideline CHASKEY Message Authentication Code (Nicky Mouha, ESAT/COSIC) CubeHash and SipHash64/128 (Daniel J. Bernstein & JP Aumasson) DSTU 7564:2014 A New Standard of Ukraine: The Kupyna Hash Function DSTU 7624:2014 Encryption Standard of Ukraine: Kalyna Block Cipher GB/T 32907-2016 - SM4 128-bit Block Cipher GB/T 32918.4-2016 SM2 Elliptic Curve Asymmetric Encryption GB/T 38636-2020 - Transport Layer Cryptography Protocol (TLCP) GM/T 0001-2012 ZUC Zu Chongzhi Stream cipher 128/256-bit key GM/T 0002-2012 SM4 Block cipher with 128-bit key GM/T 0003-2012 SM2 Public key algorithm 256-bit GM/T 0004-2012 SM3 Message digest algorithm 256-bit hash value GM/T 0044-2016 SM9 Public key algorithm 256-bit GM/T 0086-2020 Specification of key management system based on SM9 GOST 28147-89 64-bit block cipher (RFC 5830) GOST R 34.10-2012 VKO key agreement function (RFC 7836) GOST R 34.10-2012 Public Key Signature Function (RFC 7091) GOST R 34.11-2012 Streebog Key Derivation Function KDF (RFC 7836) GOST R 34.11-2012 Streebog hash function (RFC 6986) GOST R 34.11-94 CryptoPro hash function (RFC 5831) GOST R 34.12-2015 128-bit block cipher Kuznechik (RFC 7801) GOST R 34.12-2015 64-bit block cipher Magma (RFC 8891) GOST R 50.1.114-2016 GOST R 34.10-2012 and GOST R 34.11-2012 HC-128 Stream Cipher simplified version of HC-256 (Wu, ESAT/COSIC) IGE (Infinite Garble Extension) Mode of Operation for Block ciphers ISO/IEC 10118-3:2003 RIPEMD128/160/256 and Whirlpool (ESAT/COSIC) ISO/IEC 18033-3:2010 HIGHT, SEED, Camellia and MISTY1 Block ciphers ISO/IEC 18033-4:2011 KCipher-2 stream cipher (RFC 7008) ISO/IEC 29192-3:2012 Trivium Stream cipher with 80-bit key ISO/IEC 18033-5:2015 IBE - Identity-based Encryption Mechanisms ISO/IEC 18033-5:2015/Amd.1:2021(E) SM9 Mechanism ISO/IEC 14888-3:2018 EC-SDSA Schnorr-based Signature Scheme ISO/IEC 29192-2:2019 PRESENT, CLEFIA and LEA block ciphers ISO/IEC 15946-5:2022 Barreto-Naehrig and Barreto-Lynn-Scott Curves KS X 1213-1 ARIA 128-bit block cipher with 128/192/256-bit keys KS X 3246 LEA - Lightweight Encryption Algorithm (TTAK.KO-12.0223) KS X 3262 LSH - A New Fast Secure Hash Function Family (in Korean) NIST SP800-186 X25519 Diffie-Hellman (OpenSSL compliant) NIST SP800-38D GCM AEAD mode for 128-bit block ciphers (RFC 5288) RFC 1423: Privacy Enhancement for Internet Electronic Mail RFC 2104: HMAC - Keyed-Hashing for Message Authentication RFC 2144: CAST-128 64-bit Block cipher with 128-bit key RFC 2612: The CAST-256 Encryption Algorithm RFC 3610: Counter with CBC-MAC Mode of Operation (CCM Mode) RFC 4009: The SEED Encryption Algorithm (KISA) RFC 4253: Serpent 128-bit Block cipher with 128/192/256-bit keys RFC 4493: Cipher-based Message Authentication Code (CMAC) RFC 4503: Rabbit Stream Cipher Algorithm with 128-bit key RFC 4543: Galois Message Authentication Code (GMAC) RFC 4648: Base16, Base32, and Base64 Data Encodings RFC 4764: EAX Authenticated-Encryption Mode of Operation RFC 5246: Transport Layer Security (TLS) Protocol Version 1.2 RFC 5280: Internet X.509 PKI Certificate Revocation List (CRL) RFC 5639: Elliptic Curve Cryptography (ECC) Brainpool Standard Curves RFC 5869: HMAC-based Key Derivation Function (HKDF) RFC 6114: The 128-Bit Blockcipher CLEFIA (Sony) RFC 7008: KCipher-2 Encryption Algorithm (KDDI R&D Laboratories) RFC 7253: OCB (and PMAC) Authenticated-Encryption Algorithm RFC 7292: PKCS #12 Personal Information Exchange Syntax v1.1 RFC 7539: ChaCha20-Poly1305 AEAD Stream cipher RFC 7693: The BLAKE2 Cryptographic Hash and MAC (JP Aumasson) RFC 7748: Curve25519 and Curve448: Elliptic Curves for Security RFC 7914: The Scrypt Password-Based Key Derivation Function RFC 8032: Ed25519 Signature a.k.a. EdDSA (Daniel J. Bernstein) RFC 8446: Transport Layer Security (TLS) Protocol Version 1.3 RFC 9058: MGM AEAD mode for 64 and 128 bit ciphers (E. Griboedova) RFC 9367: GOST Cipher Suites for Transport Layer Security (TLS 1.3) SBRC 2007: Curupira 96-bit block cipher with 96/144/192-bit keys STB 34.101.31-2011 Belorussian standard (Bel-T) block cipher STB 34.101.45-2013 Belorussian BignV1 public key algorithhm STB 34.101.77-2020 Belorussian standard BASH hash function TTAS.KO-12.0004/R1 128-bit Block Cipher SEED (ISO/IEC 18033-3:2010) TTAS.KO-12.0040/R1 64-bit Block Cipher HIGHT (ISO/IEC 18033-3:2010) TTAS.KO-12.0011/R2 HAS-160 Korean-standardized hash algorithm TTAK.KO-12.0015/R3 EC-KCDSA Korean Digital Signature Algorithm TTAK.KO-12.0223 LEA 128-bit block cipher (ISO/IEC 29192-2:2019) TTAK.KO-12.0276 LSH Message digest algorithm (KS X 3262) US FIPS 197 Advanced Encryption Standard (AES) US FIPS 180-2 Secure Hash Standard (SHS) SHA1 and SHA2 Algorithms US FIPS 202 SHA-3 Permutation-Based Hash (instance of the Keccak) US FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism US FIPS 204 Module-Lattice-Based Digital Signature Standard US FIPS 205 Stateless Hash-Based Digital Signature Standard (SLH-DSA)
EDGETk supports Koblitz curves, where A equals 0 and B = 7 (y²=x³+7). Supports Weierstrass curves (y²=x³+ax+b), such as ECDSA, Brainpool, SM2, SM9, BLS12-381, NUMS, GOST R 34.10-2012 256-bit paramSet B, C and D, and GOST R 34.10-2012 512-bit paramSet A and B; TwistedEdwards curves (ax²+y²=1+dx²y²), such as Ed25519, Ed448, NUMS-TE, GOST R 34.10-2012 256-bit paramSet A and GOST R 34.10-2012 512-bit paramSet C; and Montgomery curves (by²=x³+ax²+x) which are functions X25519 and X448.
ECDSA: Compute \( r = x([k]G) \); \( s \) must be a root of \( H(m)s^{-1} + rs^{-1}a - k \mod n \), so compute \( s \equiv k^{-1}(H(m) + ra) \mod n \).
ECGDSA: Compute \( r = x([k]G) \); \( s \) must be a root of \( r^{-1}H(m) + r^{-1}sa - k \mod n \), so compute \( s \equiv a^{-1}(kr - H(m)) \mod n \).
ECKCDSA: Compute \( r = H(x([k]G)) \); so compute \( s \equiv a \cdot \left( k - \left( r \oplus H(cQ \parallel M) \right) \mod n \right) \mod n \).
BignV1: Compute \( R = [k]G \); \( s_0 \) must be a root of \( h(OID(H) \parallel R \parallel H(X)) \), so compute \( s_1 \equiv (k - H(X) - (s_0 + 2l)d) \mod q \).
EC-SDSA: Compute \( r = Q_x, \, h = H(M \parallel Q_x), \, s \equiv k - h \cdot d \mod n \), where \( H \) is a hash function and \( d \) is the private key.
EdDSA: Compute \( R = [k]G \); \( S \equiv k + H(R \parallel m) \cdot d \mod q \), where \( H \) is a hash function and \( d \) is the private key.
1. \( H(m) \) represents the hash value of the message.
2. \( k^{-1} \) denotes the modular multiplicative inverse of \( k \) modulo \( (p-1) \).
3. \( \equiv \) indicates congruence.
4. \( \oplus \) represents the XOR operation.
Public Key Algorithms | 256 | 512 | ECDH | Sign | Encryption | PKI |
---|---|---|---|---|---|---|
ECDSA (secp256r1) | ||||||
EC-GDSA (secp256r1) | ||||||
EC-KCDSA (secp256r1) | ||||||
EC-SDSA (secp256r1) | ||||||
ANSSI (frp256v1) | ||||||
Koblitz (secp256k1) | ||||||
BignV1 (bign256v1) | ||||||
BIP 0340 (secp256k1) | ||||||
Barreto-Lynn-Scott (bls12381) | ||||||
Barreto-Naehrig (bn256) | ||||||
Curve25519 (Ed25519 / X25519) | ||||||
Curve448 (Ed448 / X448) | ||||||
GOST R 34.10-2012 | ||||||
RSA Cryptosystem (default) | ||||||
SM2 (sm2p256v1) | ||||||
SM9 (sm9p256v1) | ||||||
NUMS (numsp256d1) | ||||||
ElGamal Cryptosystem | ||||||
EC-ElGamal Cryptosystem | ||||||
Module-Lattice (ML-DSA / ML-KEM) | ||||||
Stateless Hash (SLH-DSA) |
Subjacent Elliptic Curves | ECDSA | EC-S/GDSA | EC-KCDSA | ECKA-EG |
---|---|---|---|---|
P-224 (secp224r1) | ||||
P-256 (secp256r1) | ||||
P-384 (secp384r1) | ||||
P-521 (secp521r1) | ||||
B-283 (sect283r1) | ||||
B-409 (sect409r1) | ||||
B-571 (sect571r1) | ||||
K-283 (sect283k1) | ||||
K-409 (sect409k1) | ||||
K-571 (sect571k1) | ||||
Brainpool (brainpoolp256r1) | ||||
Brainpool (brainpoolp384r1) | ||||
Brainpool (brainpoolp512r1) | ||||
Brainpool (brainpoolp256t1) | ||||
Brainpool (brainpoolp384t1) | ||||
Brainpool (brainpoolp512t1) | ||||
BLS12-381 | ||||
Ed25519 | ||||
Pallas | ||||
ANSSI (frp256v1) | ||||
Koblitz (secp256k1) | ||||
SM2 (sm2p256v1) |
Supported ParamSets | A | B | C | D |
---|---|---|---|---|
GOST R 34.10-2012 256-bit | ||||
GOST R 34.10-2012 512-bit |
Stream Ciphers | Key Size | IV | Mode |
---|---|---|---|
Chacha20Poly1305 | |||
HC-128 | |||
HC-256 | |||
KCipher-2 | |||
Rabbit | |||
RC4 [Obsolete] | |||
Salsa20 | |||
Skein512 | |||
Spritz | |||
Trivium | |||
ZUC-128 (eea128) | |||
ZUC-256 (eea256) |
Experimental | Key Size | IV | Mode |
---|---|---|---|
Ascon 1.2 | |||
Grain128a | |||
Xoodyak v2 |
Modes | Requirements | |
---|---|---|
Encrypt-Authenticate-Translate | ||
Galois/Counter Mode (AEAD) | ||
Offset Codebook v1 (AEAD) | ||
Offset Codebook v3 (AEAD) | ||
Multilinear Galois Mode (AEAD) | ||
Counter with CBC-MAC (AEAD) | ||
Synthetic Initialization Vector (AEAD) | ||
Cipher-Block Chaining Mode | ||
Cipher Feedback Mode 8-bit | ||
Cipher Feedback Mode | ||
Counter Mode (default) | ||
Eletronic Codebook [Obsolete] | ||
Infinite Garble Extension | ||
Output Feedback Mode |
Modes | Requirements | |
---|---|---|
Cipher-based Message Authentication Code | ||
Multilinear Galois Message Authentication Code | ||
Galois Message Authentication Code | ||
Parallelizable Message Authentication Code | ||
Variable Message Authentication Code |
256-bit> Block Ciphers | Block Size | Key Size | Modes |
---|---|---|---|
Kalyna256 | |||
Kalyna512 | |||
SHACAL-2 | |||
Threefish256 | |||
Threefish512 | |||
Threefish1024 |
128-bit Block Ciphers | Block Size | Key Size | Modes |
---|---|---|---|
AES (Rijndael) | |||
Anubis | |||
ARIA | |||
Bel-T | |||
Camellia | |||
CAST256 | |||
CLEFIA | |||
CRYPTON 1.0 | |||
E2 | |||
Kalyna128 | |||
Kuznechik | |||
LEA | |||
LOKI97 | |||
MAGENTA | |||
MARS | |||
NOEKEON | |||
RC6 | |||
SEED | |||
Serpent | |||
SM4 | |||
Twofish |
96-bit Block Ciphers | Block Size | Key Size | Modes |
---|---|---|---|
Curupira |
64-bit Block Ciphers | Block Size | Key Size | Modes |
---|---|---|---|
DES [Obsolete] | |||
3DES [Almost Obsolete] | |||
Blowfish | |||
CAST5 | |||
GOST89 ParamSet Z | |||
HIGHT | |||
IDEA [Obsolete] | |||
Khazad | |||
Magma | |||
MISTY1 | |||
PRESENT | |||
RC2 [Obsolete] | |||
RC5 [Obsolete] | |||
SAFER+ | |||
TWINE |
Message Digest | 128 | 160 | 192 | 256 | 512 | MAC |
---|---|---|---|---|---|---|
BASH | ||||||
Bel-T | ||||||
BLAKE-2B | ||||||
BLAKE-2S | ||||||
BLAKE-3 | ||||||
BMW | ||||||
Chaskey | ||||||
CubeHash | ||||||
ECHO | ||||||
ESCH | ||||||
Fugue | ||||||
GOST94 CryptoPro | ||||||
Groestl | ||||||
Hamsi | ||||||
Haraka v2 | ||||||
HAS-160 [Obsolete] | ||||||
JH | ||||||
Kupyna | ||||||
Legacy Keccak | ||||||
LSH | ||||||
Luffa | ||||||
MD4 [Obsolete] | ||||||
MD5 [Obsolete] | ||||||
MD6 | ||||||
Poly1305 | ||||||
RIPEMD | ||||||
SHA1 [Obsolete] | ||||||
SHA2 (default) | ||||||
SHA3 | ||||||
SHAKE | ||||||
SHAvite-3 | ||||||
SIMD | ||||||
SipHash | ||||||
SM3 | ||||||
Streebog | ||||||
Tiger | ||||||
Whirlpool | ||||||
Xoodyak | ||||||
ZUC-256 (eia256) |
b2318928845fd314ef4dfc506492e4ba2e13459707f2df15473b75a1a747b206 *edgetk_darwin-amd64.zip c943f87b05532b53fd7292eb64ced564c6bc2e5a00fbe3dcba78d384581d2265 *edgetk_darwin-arm64.zip 51d999da793f458a77dc440a06ad5c34d2a2da595affbb4f5cd5756348e88011 *edgetk_freebsd-amd64.zip b63b99314194bbb42fce6fa0ee7654872fa8793a0c71c99b5d7b1791c300b1ec *edgetk_freebsd-x86.zip a1344494ce806bf5eb618d248c008a8cf3d7b22df052615f77ecef0507bf78c2 *edgetk_linux-amd64.zip 28bdb32c127a2d3fc30cd987850edc5a4b61b851a76c06f6a613fde2d37a5994 *edgetk_linux-armel.zip f472625008d8cc74a25ef783b33c15441e9a292319a1243e57c575493cacfce4 *edgetk_linux-x86.zip 1b110b9f18e45af009a3c4ed31188b3527fb5346be8778380ae8eda0681cd144 *edgetk_openbsd-amd64.zip dd0cdbbf40ff97ed296240f1d293d37ba62e0b8901105dfb918566c7c42f792b *edgetk_openbsd-x86.zip 8c16c041ac3b4cc594f87051b11a0685d1291dc323d7801d822dd84f77262ade *edgetk_win32.zip e6197c78c96c5142d046fa6dc8646855b0cee3b89ef9571380ef76b52105d2a7 *edgetk_win64.zip
-algorithm string Public key algorithm: EC, Ed25519, GOST2012, SM2. (default "RSA") -base32 string Encode binary string to Base32 format and vice-versa. [enc|dec] -base64 string Encode binary string to Base64 format and vice-versa. [enc|dec] -base85 string Encode binary string to Base85 format and vice-versa. [enc|dec] -bits int Key length. (for keypair generation and symmetric encryption) -cacert string CA Certificate path. (for TLCP Protocol) -cakey string CA Private key. (for TLCP Protocol) -cert string Certificate path. -check Check hashsum file. ('-' for STDIN) -cipher string Symmetric algorithm: aes, blowfish, magma or sm4. (default "aes") -crl string Certificate Revocation List path. -crypt string Bulk Encryption with Stream and Block ciphers. [enc|dec|help] -curve string Subjacent curve (ECDSA, BLS12381G1 and G2.) (default "ecdsa") -digest Target file/wildcard to generate hashsum list. ('-' for STDIN) -factorp string Makwa private Factor P. (for Makwa Password-hashing Scheme) -factorq string Makwa private Factor Q. (for Makwa Password-hashing Scheme) -hex string Encode binary string to hex format and vice-versa. [enc|dump|dec] -hid uint Hierarchy Identifier. (for SM9 User Private Key) (default 1) -id string User Identifier. (for SM9 User Private Key operations) -info string Additional info. (for HKDF command and AEAD bulk encryption) -ipport string Local Port/remote's side Public IP:Port. -iter int Iter. (for Password-based key derivation function) (default 1) -iv string Initialization Vector. (for symmetric encryption) -kdf string Key derivation function. [pbkdf2|hkdf|scrypt|argon2] -key string Asymmetric key, symmetric key or HMAC key, depending on operation. -mac string Compute Hash/Cipher-based message authentication code. -master string Master key path. (for sm9 setup) (default "Master.pem") -md string Hash algorithm: sha256, sha3-256 or whirlpool. (default "sha256") -mode string Mode of operation: GCM, MGM, CBC, CFB8, OCB, OFB. (default "CTR") -modulus string Makwa modulus. (Makwa hash Public Parameter) -nopad No padding. (for Base64 and Base32 encoding) -params string ElGamal Public Parameters path. -paramset string Elliptic curve ParamSet: A, B, C, D. (for GOST2012) (default "A") -pass string Password/Passphrase. (for Private key PEM encryption) -passout string User Password. (for SM9 User Private Key PEM encryption) -peerid string Remote's side User Identifier. (for SM9 Key Exchange) -pkey string Subcommands: keygen|certgen, sign|verify|derive, text|modulus. -priv string Private key path. (for keypair generation) (default "Private.pem") -pub string Public key path. (for keypair generation) (default "Public.pem") -rand int Generate random cryptographic key with given bit length. -recover Recover Passphrase from Makwa hash with Private Parameters. -recursive Process directories recursively. (for DIGEST command only) -root string Root CA Certificate path. -salt string Salt. (for HKDF and PBKDF2 commands) -signature string Input signature. (for VERIFY command and MAC verification) -tcp string Encrypted TCP/IP Transfer Protocol. [server|ip|client] -version Print version info. -wrap int Wrap lines after N columns. (for Base64/32 encoding) (default 64)
./edgetk -pkey keygen -bits 4096 [-pass "pass"]
./edgetk -pkey sign -key private.pem [-pass "pass"] < file.ext > sign.txt
sign=$(cat sign.txt|awk '{print $2}')
./edgetk -pkey verify -key public.pem -signature $sign < file.ext
echo $?
./edgetk -pkey keygen -algorithm ECDSA -bits 256 [-pass "pass"]
./edgetk -pkey derive -key private.pem -public peerkey.pem
./edgetk -crypt enc -key $shared < plaintext.ext > ciphertext.ext
./edgetk -crypt dec -key $shared < ciphertext.ext > plaintext.ext
./edgetk -mac cmac -key $128bitkey < file.ext
./edgetk -digest [-recursive] "*.*"
./edgetk -digest - < file.ext
./edgetk -mac hmac -key $256bitkey < file.ext
Copyright (c) 2021 Pedro F. Albanese <pedroalbanese@hotmail.com>
Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.