///
interface EncryptAes256CbcHmacRequest {
payload: Buffer;
/**
* 64 bytes
* 32 first bytes are used for encryption
* 32 last bytes are used for MAC
*/
combinedKey: Buffer;
/**
* uuid of the key used to encrypt the payload. This gives us the possibility to understand what
* was used to encrypt and then debug encryption issue.
*/
keyUuid: string;
}
export declare const encryptAes256CbcHmac: (params: EncryptAes256CbcHmacRequest) => Promise;
interface DecryptAes256CbcHmacRequest {
/**
* Full encrypted string with possibly uuid%data, including the crypto identifier
*/
encryptedData: string;
/**
* 64 bytes
* 32 first bytes are used for encryption
* 32 last bytes are used for MAC
*/
combinedKey: Buffer;
}
export declare const decryptAes256CbcHmac: (params: DecryptAes256CbcHmacRequest) => Promise;
/**
* To identify the key used to encrypt a set of data, we concatenate key uuid with encrypted Data
* The concatenation is done with "%"
* @param keyUuid uuid of the key used to encrypt the data
* @param encryptedData
*/
export declare const concatUuidWithEncryptedData: (keyUuid: string, encryptedData: string) => string;
/**
* Check MAC in constant time, to avoid theorical timing attack
*/
export declare const safeCrytoEquals: (b1: Buffer, b2: Buffer) => boolean;
export {};