#vim #decryption #crypt #command-line-tool #vimcrypt

bin+lib vimdecrypt

A rust library and command line tool to read encrypted Vim files

4 releases

0.1.3 Jun 9, 2020
0.1.2 Nov 13, 2018
0.1.1 Jun 30, 2018
0.1.0 Jun 30, 2018

#8 in #decrypt

MIT license

340KB
195 lines

vimdecrypt-rs

A rust library and command line tool to read encrypted Vim files. The crate comes with a simple public API and a simple CLI tool.

As Vim needs to keep all files it edits in memory, this crate operates on the assumption that this is feasible, i.e. it does not provide a streaming API.

API

The API consisting of a single function that decodes a block of bytes given a password, which has to be valid UTF-8. A simple function to encode a file by its path might look like this:

fn decrypt_file(filename: &str) -> String {
    let data = fs::read(filename).unwrap();
    const PASSWORD: &str = "blubberfish";
    vimdecrypt::decrypt(&data, &PASSWORD).expect("Decryption failed.")
}

License

vimdecrypt-rs is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.


lib.rs:

A simple crate to decrypt Vim encrypted files.

Dependencies

~4.5MB
~83K SLoC