secure-encrypt
Version:
A package that simplifies data encryption and decryption, supporting various algorithms and providing a straightforward API for developers.
15 lines (14 loc) • 566 B
TypeScript
/**
* Encrypt a plaintext using a secret key.
* @param plaintext - The text to encrypt.
* @param secretKey - The secret key for encryption.
* @returns The encrypted text (base64-encoded).
*/
export declare const encrypt: (plaintext: string, secretKey: string) => string;
/**
* Decrypt an encrypted text using a secret key.
* @param encryptedText - The text to decrypt (base64-encoded).
* @param secretKey - The secret key for decryption.
* @returns The decrypted text.
*/
export declare const decrypt: (encryptedText: string, secretKey: string) => string;