UNPKG

@shaaz1000/rn-storage

Version:

A comprehensive storage solution for React Native with encryption, caching, and offline sync

48 lines 1.3 kB
declare class Encryption { private static encryptionKey; /** * Initialize encryption with a secret key * @param secretKey - Secret key for encryption/decryption */ static initialize(secretKey: string): void; /** * Get the current encryption key or throw error if not initialized */ private static getKey; /** * Simple XOR encryption/decryption * @param text - Text to encrypt/decrypt * @returns Encrypted/Decrypted text */ private static xorEncrypt; /** * Convert string to base64 * @param str - String to convert * @returns Base64 string */ private static toBase64; /** * Convert base64 to string * @param str - Base64 string to convert * @returns Decoded string */ private static fromBase64; /** * Encrypt data * @param data - Data to encrypt * @returns Encrypted string */ static encrypt(data: any): string; /** * Decrypt data * @param encryptedData - Data to decrypt * @returns Decrypted data */ static decrypt(encryptedData: string): any; /** * Reset encryption key (useful for testing or key rotation) */ static reset(): void; } export default Encryption; //# sourceMappingURL=encryption.d.ts.map