Walker.Crypto.AESFileEncryptor
A fun little function for encrypting and decrypting a file with AES256GCM.
Values
ChunkSize
An integer representing the size of each chunk encrypted (in this case 4418.)
Methods
EncryptFileAsync(string inputPath, string outputPath, SecureData password, Action progress = null)
Encrypts a file asynchronously using AES-GCM. Reads the input file in chunks, encrypts each chunk, and writes the result to the output file.
-
Parameters:
- inputPath: Path of the file to encrypt.
- outputPath: Path where the encrypted file will be saved.
- password: Secure password to derive the encryption key.
- progress: Optional callback for progress tracking, with a value from 0.0 to 1.0.
-
Returns: Task
DecryptFileAsync(string inputPath, string outputPath, SecureData password, Action progress = null)
Decrypts an encrypted file asynchronously. Reads the encrypted file in chunks, decrypts each chunk, and writes the result to the output file.
-
Parameters:
- inputPath: Path of the encrypted file.
- outputPath: Path where the decrypted file will be saved.
- password: Secure password to derive the decryption key.
- progress: Optional callback for progress tracking.
-
Returns: Task