-
<static> generateSessionKey(algo) → {String}
-
Generating a session key for the specified symmetric algorithm
Parameters:
- Source:
Returns:
Random bytes as a string to be used as a key
-
Type
-
String
-
<static> getPrefixRandom(algo) → {String}
-
generate random byte prefix as string for the specified algorithm
Parameters:
- Source:
Returns:
Random bytes with length equal to the block
size of the cipher
-
Type
-
String
-
<static> getPrivateMpiCount(algo) → {Integer}
-
Returns the number of integers comprising the private key of an algorithm
Parameters:
Name |
Type |
Description |
algo |
String
|
The public key algorithm |
- Source:
Returns:
The number of integers.
-
Type
-
Integer
-
<static> publicKeyDecrypt(algo, publicMPIs, secretMPIs, data) → {module:type/mpi}
-
Decrypts data using the specified public key multiprecision integers of the private key,
the specified secretMPIs of the private key and the specified algorithm.
Parameters:
- Source:
Returns:
returns a big integer containing the decrypted data; otherwise null
-
Type
-
module:type/mpi
-
<static> publicKeyEncrypt(algo, publicMPIs, data) → {Array.<module:type/mpi>}
-
Encrypts data using the specified public key multiprecision integers
and the specified algorithm.
Parameters:
- Source:
Returns:
if RSA an module:type/mpi;
if elgamal encryption an array of two module:type/mpi is returned; otherwise null
-
Type
-
Array.<module:type/mpi>