strong-cryptor
Version:
Strong encryptor and decryptor nodejs
18 lines (17 loc) • 1.31 kB
TypeScript
import { BufferAndString, IDecryptionOptions, IToBufferOptions } from '../typings';
/**
* decrypt the encrypted data from strong-cryptor
* @param {string} encryptedData encrypted string
* @param {string} key (or secret) is 256bits (32 charcters) that used to encrypt dan decrypt the data (must be same with the encryption process), please store it in the safe places
* @param {IDecryptionOptions} options decryption options, see [[IDecryptionOptions]] for more details
* @returns {string|Buffer} return decrypted string/Buffer
*/
export declare function decrypt<T extends IToBufferOptions>(encryptedString: string, key: string, options?: T & IDecryptionOptions): BufferAndString<T>;
/**
* decrypt file that already encrypted from strong-cryptor
* @param {string} filePath path to file
* @param {string} key (or secret) is 256bits (32 charcters) that used to encrypt dan decrypt the data (must be same with the encryption process), please store it in the safe places
* @param {IDecryptionOptions} options decryption options, see [[IDecryptionOptions]] for more details
* @returns {string|Buffer} return decrypted string/Buffer
*/
export declare function decryptFile<T extends Required<IToBufferOptions>>(filePath: string, key: string, options?: Partial<T> & IDecryptionOptions): BufferAndString<T>;