Object implements dedicated Web Workers and provide a simple way to create
and run GOST cryptographic algorithms in background thread.
Object provide interface to GOST low-level cryptogric classes:
- GostCipher - implementation of GOST 28147, GOST R 34.12, GOST R 34.13 Encryption algorithms. Reference http://tools.ietf.org/html/rfc5830
- GostDigest - implementation of GOST R 34.11 Hash Function algorithms. References http://tools.ietf.org/html/rfc5831 and http://tools.ietf.org/html/rfc6986
- GostSign - implementation of GOST R 34.10 Digital Signature algorithms. References http://tools.ietf.org/html/rfc5832 and http://tools.ietf.org/html/rfc7091
- Source:
Members
-
(static) onmessage
-
Method called when SubtleCrypto calls its own postMessage() method with data parameter: algorithm, method and arg.
Call method execute and postMessage() results to onmessage event handler in the main process.
If error occured onerror event handler executed in main process.- Source:
Methods
-
(static) execute(algorithm, method, args) → {CryptoOperationData|Key|KeyPair|boolean}
-
gostEngine.execute(algorithm, method, args) Entry point to execution all low-level GOST cryptographic methods
- Determine the appropriate engine for a given execution method
- Create cipher object for determineted engine
- Execute method of cipher with given args
Parameters:
Name Type Description algorithmAlgorithmIndentifier Algorithm identifier methodstring Crypto method for execution argsArray Method arguments (keys, data, additional parameters) - Source:
Returns:
Result of method execution- Type
- CryptoOperationData | Key | KeyPair | boolean
-
(static) getGostCipher(algorithm) → {GostCipher}
-
gostEngine.getGostCipher(algorithm) returns GOST 28147 / GOST R 34.12 cipher instance
GOST 28147-89 / GOST R 34.12-15 Encryption Algorithm
When keys and initialization vectors are converted to/from byte arrays, little-endian byte order is assumed.
Normalized algorithm identifier common parameters:- name Algorithm name 'GOST 28147' or 'GOST R 34.12'
- version Algorithm version, number
- 1989 Current version of standard
- 2015 New draft version of standard
- length Block length
- 64 64 bits length (default)
- 128 128 bits length (only for version 2015)
- mode Algorithm mode, string
- ES Encryption mode (default)
- MAC "imitovstavka" (MAC) mode
- KW Key wrapping mode
- MASK Key mask mode
- sBox Paramset sBox for GOST 28147-89, string. Used only if version = 1989
- Encript/Decrypt mode (ES)
- block Block mode, string. Default ECB
- keyMeshing Key meshing mode, string. Default NO
- padding Padding mode, string. Default NO for CFB and CTR modes, or ZERO for others
- iv CryptoOperationData Initial vector with length of block. Default - zero block
- Sign/Verify mode (MAC)
- macLength Length of mac in bits (default - 32 bits)
- iv CryptoOperationData Initial vector with length of block. Default - zero block
- Wrap/Unwrap key mode (KW)
- keyWrapping Mode of keywrapping, string. Default NO - standard GOST key wrapping
- ukm CryptoOperationData User key material. Default - random generated value
- Wrap/Unwrap key mode (MASK)
- Block modes (parameter 'block')
- ECB "prostaya zamena" (ECB) mode (default)
- CFB "gammirovanie s obratnoj svyaziyu" (64-bit CFB) mode
- CTR "gammirovanie" (counter) mode
- CBC Cipher-Block-Chaining (CBC) mode
- Key meshing modes (parameter 'keyMeshing')
- NO No key wrapping (default)
- CP CryptoPor Key key meshing
- Padding modes (parameter 'padding')
- NO No padding only for CFB and CTR modes
- PKCS5 PKCS#5 padding mode
- ZERO Zero bits padding mode
- RANDOM Random bits padding mode
- Wrapping key modes (parameter 'keyWrapping')
- NO Ref. rfc4357 6.1 GOST 28147-89 Key wrapping
- CP CryptoPro Key wrapping mode
- SC SignalCom Key wrapping mode
Parameters:
Name Type Description algorithmAlgorithmIndentifier Algorithm identifier - Source:
Returns:
Instance of GostCipher- Type
- GostCipher
-
(static) getGostDigest(algorithm) → {GostDigest}
-
gostEngine.getGostDigest(algorithm) returns GOST R 34.11 cipher instance
Normalized algorithm identifier common parameters:- name Algorithm name 'GOST R 34.11'
- version Algorithm version
- 1994 old-style 256 bits digest based on GOST 28147-89
- 2012 256 ro 512 bits digest algorithm "Streebog" GOST R 34.11-2012 (default)
- length Digest length
- 256 256 bits digest
- 512 512 bits digest, valid only for algorithm "Streebog"
- mode Algorithm mode
- HASH simple digest mode (default)
- HMAC HMAC algorithm based on GOST R 34.11
- KDF Derive bits for KEK deversification
- PBKDF2 Password based key dirivation algorithms PBKDF2 (based on HMAC)
- PFXKDF PFX key dirivation algorithms PFXKDF
- CPKDF CryptoPro Password based key dirivation algorithms
- sBox Paramset sBox for GOST 28147-89. Used only if version = 1994
- Digest HASH mode (default)
- Sign/Verify HMAC modes parameters depends on version and length
- version: 1994 HMAC parameters (B = 32, L = 32)
- version: 2012, length: 256 HMAC parameters (B = 64, L = 32)
- version: 2012, length: 512 HMAC parameters (B = 64, L = 64)
- DeriveBits/DeriveKey KDF mode
- context CryptoOperationData Context of the key derivation
- label CryptoOperationData Label that identifies the purpose for the derived keying material
- DeriveBits/DeriveKey PBKDF2 mode
- salt CryptoOperationData Random salt as input for HMAC algorithm
- iterations Iteration count. GOST recomended value 1000 (default) or 2000
- DeriveBits/DeriveKey PFXKDF mode
- salt CryptoOperationData Random salt as input for HMAC algorithm
- iterations Iteration count. GOST recomended value 1000 (default) or 2000
- diversifier Deversifier, ID=1 - key material for performing encryption or decryption, ID=2 - IV (Initial Value) for encryption or decryption, ID=3 - integrity key for MACing
- DeriveBits/DeriveKey CPKDF mode
- salt CryptoOperationData Random salt as input for HMAC algorithm
- iterations Iteration count. GOST recomended value 1000 (default) or 2000
Parameters:
Name Type Description algorithmAlgorithmIndentifier Algorithm identifier - Source:
Returns:
Instance of GostDigest- Type
- GostDigest
-
(static) getGostSign(algorithm) → {GostSign}
-
gostEngine.getGostSign(algorithm) returns GOST R 34.10 cipher instance
Normalized algorithm identifier common parameters:- name Algorithm name 'GOST R 34.10'
- version Algorithm version
- 1994 - Old-style GOST R 34.10-94 ExpMod algorithm with GOST R 34.11-94 hash
- 2001 - GOST R 34.10-2001 Eliptic curve algorithm with old GOST R 34.11-94 hash
- 2012 - GOST R 34.10-2012 Eliptic curve algorithm with GOST R 34.11-12 hash, default mode
- length Length of hash and signature. Key length == hash length for EC algorithms and 2 * hash length for ExpMod algorithm
- GOST R 34.10-256 - 256 bits digest, default mode
- GOST R 34.10-512 - 512 bits digest only for GOST R 34.11-2012 hash
- mode Algorithm mode
- SIGN Digital signature mode (default)
- DH Diffie-Hellman key generation and key agreement mode
- MASK Key mask mode
- sBox Paramset sBox for GOST 34.11-94. Used only if version = 1994 or 2001
- Sign/Verify mode (SIGN)
- Wrap/Unwrap mode (MASK)
- DeriveKey/DeriveBits mode (DH)
- CryptoOperationData ukm User key material. Default - random generated value
- CryptoOperationData public The peer's EC public key data
- GenerateKey mode (SIGN and DH and MASK) version = 1994
- namedParam Paramset for key generation algorithm. If specified no additianal parameters required
- modulusLength Bit length of p (512 or 1024 bits). Default = 1024
- p CryptoOperationData Modulus, prime number, 2^(t-1)
- q CryptoOperationData Order of cyclic group, prime number, 2^254
- a CryptoOperationData Generator, integer, 1
- GenerateKey mode (SIGN and DH and MASK) version = 2001 or 2012
- namedCurve Paramset for key generation algorithm. If specified no additianal parameters required
- p CryptoOperationData Prime number - elliptic curve modulus
- a CryptoOperationData Coefficients a of the elliptic curve E
- b CryptoOperationData Coefficients b of the elliptic curve E
- q CryptoOperationData Prime number - order of cyclic group
- x CryptoOperationData Base point p x-coordinate
- y CryptoOperationData Base point p y-coordinate
Parameters:
Name Type Description algorithmAlgorithmIndentifier Algorithm identifier - Source:
Returns:
Instance of GostSign- Type
- GostSign