fast-envcrypt
Version:
Secure AES-256 .env file encryption CLI tool with argon2/scrypt support
33 lines • 1.24 kB
TypeScript
export declare function generateKey(password: string, salt: Buffer, algo?: "argon2" | "scrypt"): Promise<Buffer>;
export declare function encrypt(text: string, password: string, algo?: "argon2" | "scrypt"): Promise<string>;
export declare function decrypt(data: string, password: string): Promise<string>;
/**
* Secure password input - FIXED VERSION
*/
export declare function getPassword(prompt: string): Promise<string>;
export declare function validateEnvFile(content: string): boolean;
/**
* Clear sensitive data from memory (best effort)
*/
export declare function clearSensitiveData(obj: any): void;
/**
* Sanitize file path for security
*/
export declare function sanitizePath(filePath: string): string;
/**
* Generate a secure random string
*/
export declare function generateRandomString(length?: number): string;
/**
* Secure memory allocation for sensitive data
*/
export declare function secureBuffer(size: number): Buffer;
/**
* Constant-time string comparison to prevent timing attacks
*/
export declare function constantTimeCompare(a: string, b: string): boolean;
/**
* Get file size in human readable format
*/
export declare function formatFileSize(bytes: number): string;
//# sourceMappingURL=utils.d.ts.map