#office #excel #encrypt

bin+lib msoffice_crypt

msoffice-crypt bindings for the Rust programming language

6 releases

0.1.5 Apr 11, 2023
0.1.4 Apr 10, 2023

#535 in Cryptography

Download history 28/week @ 2023-07-28 20/week @ 2023-08-04 8/week @ 2023-08-11 13/week @ 2023-08-18 12/week @ 2023-08-25 6/week @ 2023-09-01 21/week @ 2023-09-08 8/week @ 2023-09-15 3/week @ 2023-09-22 9/week @ 2023-09-29 8/week @ 2023-10-06 11/week @ 2023-10-13 8/week @ 2023-10-20 16/week @ 2023-10-27 9/week @ 2023-11-03 15/week @ 2023-11-10

51 downloads per month
Used in 2 crates

BSD-3-Clause

3MB
122 lines

Contains (ELF lib, 2MB) lib/libmsoc.so, (Windows DLL, 1MB) lib/msoc.dll

msoffice crypt lib

msoffice-crypt bindings for the Rust programming language.

A lib to encrypt/decrypt Microsoft Office Document

requirement

you must add the lib libmsoc.so to the system lib before run the bin app.

1.linux:

libmsoc.so

you must compile the lib youself , read more

export LD_LIBRARY_PATH=some/path/to/libmsoc.so/dir:$LD_LIBRARY_PATH

2.windows:

msoc.dll

set PATH=some\path\to\libmsoc.dll\dir;%PATH%

example

use msoffice_crypt::{encrypt,decrypt};
fn main() {
        # encrypt the input to output file
        let input = "/home/feiy/Desktop/1.xlsx";
        let output = "/home/feiy/Desktop/output.xlsx";
        let password = "test";
        let ret = encrypt(input,password,Some(output));
        println!("{ret:#?}");
        # decrypt the input file to output file
        let plain = "/home/feiy/Desktop/plain.xlsx";
        let ret = decrypt(output,password,Some(plain));
        println!("{ret:#?}");
        // overwrite the input file
        let plain = "/home/feiy/Desktop/plain.xlsx";
        let ret = encrypt(plain,password,None);
        println!("{ret:#?}");
        
}

No runtime deps