vimdecrypt

Crates.iovimdecrypt
lib.rsvimdecrypt
version0.1.3
sourcesrc
created_at2018-06-30 20:48:28.837058
updated_at2020-06-09 09:59:39.75817
descriptionA rust library and command line tool to read encrypted Vim files.
homepagehttps://github.com/SirVer/vimdecrypt-rs
repositoryhttps://github.com/SirVer/vimdecrypt-rs
max_upload_size
id72362
size365,189
Holger Rapp (SirVer)

documentation

https://docs.rs/vimdecrypt

README

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.

Commit count: 18

cargo fmt