UNPKG

system-secured-storage

Version:

A Node.js project that allows users to store encrypted key-value data locally on their system. This project serves as an alternate storage solution to SQLite but with enhanced security features, leveraging AES encryption to ensure the confidentiality and

33 lines (32 loc) 794 B
/** * The service use 'aes-256-ctr' aes algorithm by default. * * @exports * @class EncryptionService */ export declare class EncryptionService { private key; private iv; private readonly algorithm; /** * Create an instance of the encrytion service. * * @param {string} key - The AES encryption key. * @param {string} iv - The iv key. */ constructor(key: string, iv: string); /** * Encrypt data. * * @param {data} data - The data to be encrypted. * @returns {string} - Encrypted data. */ encrypt(data: any): string; /** * Decrypt data. * * @param {string} encryptedData - The encrypted data. * @returns {T} - The decrypted data. */ decrypt<T = any>(encryptedData: string): T; }