Using the Deno runtime to encrypt, compress, and recover a file.
-
This package uses
wasm-flate.wasm
built from this repository to compress/decompress files. -
The
wasm-flate
module is a thin wasm wrapper around the flate2 crate. -
The aes128 encryption/decryption is done using
wasm-aes-soft.asm
built from this repository. -
The
wasm-aes-soft
module is a thin wasm wrapper around the aes-soft crate.
deno run --allow-read --allow-write encrypt.ts sample.txt
Running this will create two files:
sample.enc.txt
sample.key
At this point, because padding is used while decrypting, for text files one has to filter out the null character.
deno run --allow-read --allow-write decrypt.ts sample.enc.txt sample.key true
For any other file type the last flag can be ignored.