Rust implementation for the Crypt4GH encryption format.
Requirements: Rust
sh
cargo install --git https://github.com/EGA-archive/crypt4gh-rust.git
In the releases page, You can find compiled binaries for:
```text Utility for the cryptographic GA4GH standard, reading from stdin and outputting to stdout.
USAGE: crypt4gh [FLAGS] [SUBCOMMAND]
FLAGS: -h, --help Prints help information -v, --verbose Sets the level of verbosity -V, --version Prints version information
SUBCOMMANDS: decrypt Decrypts the input using your secret key and the (optional) public key of the sender. encrypt Encrypts the input using your (optional) secret key and the public key of the recipient. help Prints this message or the help of the given subcommand(s) rearrange Rearranges the input according to the edit list packet. reencrypt Decrypts the input using your (optional) secret key and then it reencrypts it using the public key of the recipient. ```
Alice and Bob generate both a pair of public/private keys.
sh
crypt4gh keygen --sk alice.sec --pk alice.pub
crypt4gh keygen --sk bob.sec --pk bob.pub
Bob encrypts a file for Alice:
sh
crypt4gh encrypt --sk bob.sec --recipient_pk alice.pub < file > file.c4gh
Alice decrypts the encrypted file:
sh
crypt4gh decrypt --sk alice.sec < file.c4gh
Add this to your Cargo.toml
:
toml
[dependencies]
crypt4gh = "0.1.0"
Use the exposed functions:
```rust
pub fn encrypt(
recipientkeys: &HashSet
pub fn decrypt(
keys: Vec
pub fn reencrypt(
keys: Vec
pub fn rearrange(
keys: Vec
To learn more about Crypt4GH, see the official documentation.
To build from source on Windows, you should first have installed the MSVC Build Tools.