Namespace: Crypto

Crypto

Cryptograpphy Utility Class
Source:

Methods

(static) decrypt(algopt) → {ByteArray}

Decrypts a bytes array
Parameters:
Name Type Attributes Default Description
ByteArray the data to decrypt
string the encryption paraphrase
alg 'AES' | 'DES' <optional>
AES the encryption algorithm
Source:
Returns:
the decrypted data
Type
ByteArray

(static) encrypt(algopt) → {Array.<byte>}

Encrypts a bytes array
Parameters:
Name Type Attributes Default Description
ByteArray the data to encrypt
string the encryption paraphrase
alg 'AES' | 'DES' <optional>
AES the encryption algorithm
Source:
Returns:
the encrypted data
Type
Array.<byte>

(static) hmac(algopt, hashingopt) → {string}

Produces a hmac of a bytes array using an hmac algorith and a hashing algorithm
Parameters:
Name Type Attributes Default Description
ByteArray the data to hmac
string the hmac key
alg 'SHA1' | 'SHA256' <optional>
SHA256 the hmac algorithm
hashing 'HEXA' | 'BASE64' <optional>
HEXA the hashing algorithm
Source:
Returns:
the encrypted string
Type
string

(static) md5(charsetopt) → {string}

Encrypt a string or a bytes array using md5
Parameters:
Name Type Attributes Description
string | ByteArray the data to encrypt
charset string <optional>
the charset to be used if data is a string
Source:
Returns:
the encrypted string
Type
string