Crates.io | vimdecrypt |
lib.rs | vimdecrypt |
version | 0.1.3 |
source | src |
created_at | 2018-06-30 20:48:28.837058 |
updated_at | 2020-06-09 09:59:39.75817 |
description | A rust library and command line tool to read encrypted Vim files. |
homepage | https://github.com/SirVer/vimdecrypt-rs |
repository | https://github.com/SirVer/vimdecrypt-rs |
max_upload_size | |
id | 72362 |
size | 365,189 |
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.
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.")
}
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.