@deadmansswitch/encryption
Version:
Cross-platform encryption library for React Native and React web applications with password-based encryption
23 lines (22 loc) • 555 B
TypeScript
export interface EncryptionOptions {
password: string;
iterations?: number;
keyLength?: number;
}
export interface EncryptionResult {
encryptedData: string;
salt: string;
iv: string;
}
export interface DecryptionOptions {
password: string;
encryptedData: string;
salt: string;
iv: string;
iterations?: number;
keyLength?: number;
}
export interface CryptoService {
encrypt(data: string, options: EncryptionOptions): Promise<EncryptionResult>;
decrypt(options: DecryptionOptions): Promise<string>;
}