easy-cipher-mate
Version:
A CLI and programmatic tool for encryption/decryption supporting AES-GCM and ChaCha20-Poly1305 algorithms, with text encoding options and line-by-line text file processing.
16 lines (15 loc) • 1.05 kB
TypeScript
import { IEncryptionAlgorithm, EncryptionResult, EncryptionConfigType } from '../encryption/IEncryptionAlgorithm';
import { TextEncoding } from '../utils/encodingUtils';
export declare class EncryptionService<TAlgorithm extends IEncryptionAlgorithm<any>, TConfig extends EncryptionConfigType<TAlgorithm>> {
private algorithm;
private algorithmConfig;
constructor(algorithm: TAlgorithm, algorithmConfig: TConfig);
encryptText(plaintext: string, encoding?: TextEncoding): Promise<EncryptionResult>;
decryptText(encryptedData: ArrayBuffer, encoding?: TextEncoding): Promise<string>;
encryptFile(fileBuffer: ArrayBuffer, encoding?: TextEncoding): Promise<EncryptionResult>;
decryptFile(encryptedBuffer: ArrayBuffer, encoding?: TextEncoding): Promise<ArrayBuffer>;
encryptFileByName(fileName: string): Promise<EncryptionResult>;
decryptFileByName(encryptedResult: EncryptionResult, fileName: string): Promise<void>;
arrayBufferToString(buffer: ArrayBuffer): string;
stringToArrayBuffer(str: string): ArrayBuffer;
}