@polgubau/utils
Version:
A collection of utility functions for TypeScript
17 lines (15 loc) • 502 B
text/typescript
/**
* Encrypts a text using AES-GCM.
* @param text - Text to encrypt
* @param key - Key to encrypt the text
* @returns Encrypted text in base64
*/
declare function encrypt(text: string, key: string): Promise<string>;
/**
* Decrypts an encrypted text using AES-GCM.
* @param encryptedText - Encrypted text in base64
* @param key - Key to decrypt the text
* @returns Decrypted text
*/
declare function decrypt(encryptedText: string, key: string): Promise<string>;
export { decrypt, encrypt };