/** * CRYPTOGRAPHIC FUNCTIONS ===================================================== * ============================================================================= */ /** * Sign message with secret key using native Node.js crypto (fastest) * * @param {string} text - to sign * @param {string} key - secret * @param {string} [algo] - cryptographic algorithm to use * @param {string} [format] - output hash type, one of ['binary', 'hex', 'base64'] * @param {string} [encoding] - input data type, one of ['binary', 'hex', 'base64'] * @return {string} - signature */ export function cryptoSign(text: string, key: string, algo?: string | undefined, format?: string | undefined, encoding?: string | undefined): string; /** * Verify Signature integrity for given Message with Secret key * * @param {string} signature - to verify * @param {string} message - to sign * @param {string} key - secret * @param {string} [algo] - cryptographic algorithm to use * @param {string} [format] - output hash type, one of ['binary', 'hex', 'base64'] * @return {boolean} - true if signature is valid, else false */ export function cryptoSignVerify(signature: string, message: string, key: string, algo?: string | undefined, format?: string | undefined): boolean; /** * Hash message using native Node.js crypto (fastest) * * @param {string} text - to hash * @param {string} [algo] - cryptographic algorithm to use * @param {string} [format] - output hash type, one of ['binary', 'hex', 'base64'] * @return {string} - hash */ export function cryptoHash(text: string, algo?: string | undefined, format?: string | undefined): string; /** * Encrypt Text string * * @param {String} text - message to encrypt * @param {String} key - at least 32 characters secret * @param {string} [algo] - cryptographic algorithm to use * @return {string} - encrypted text */ export function encrypt(text: string, key: string, algo?: string | undefined): string; /** * Decrypt Text string * * @param {String} text - content with IV prefix to decrypt * @param {String} key - at least 32 characters secret * @param {string} [algo] - cryptographic algorithm to use * @return {string} - decrypted text */ export function decrypt(text: string, key: string, algo?: string | undefined): string;