ega-archive/crypt4gh-rust

Rust implementation for the Crypt4GH encryption format

In the Linux (x86_64-unknown-linux-gnu)

crypt4gh-rust

.

CLI

Installation

From source

Requirements: Rust

cargo install crypt4gh

Binaries

In the releases page, You can find compiled binaries for:

  • Linux (x86_64-unknown-linux-gnu)
  • OS X (x86_64-apple-darwin)
  • Windows (x86_64-pc-windows-msvc)

Usage

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)
    keygen       Utility to create Crypt4GH-formatted keys.
    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.

Example

Alice and Bob generate both a pair of public/private keys.

crypt4gh keygen --sk alice.sec --pk alice.pub
crypt4gh keygen --sk bob.sec --pk bob.pub

Bob encrypts a file for Alice:

crypt4gh encrypt --sk bob.sec --recipient_pk alice.pub < file > file.c4gh

Alice decrypts the encrypted file:

crypt4gh decrypt --sk alice.sec < file.c4gh

Library

Library installation

Add this to your Cargo.toml:

[dependencies]
crypt4gh = "0.4.0"

Usage (in Rust)

Use the exposed functions:

pub fn encrypt<R: Read, W: Write>(
    recipient_keys: &HashSet<Keys>,
    read_buffer: &mut R,
    write_buffer: &mut W,
    range_start: usize,
    range_span: Option<usize>
) -> Result<()>

pub fn decrypt<R: Read, W: Write>(
    keys: Vec<Keys>,
    read_buffer: &mut R,
    write_buffer: &mut W,
    range_start: usize,
    range_span: Option<usize>,
    sender_pubkey: Option<Vec<u8>>,
) -> Result<()>

pub fn reencrypt<R: Read, W: Write>(
    keys: Vec<Keys>,
    recipient_keys: HashSet<Keys>,
    read_buffer: &mut R,
    write_buffer: &mut W,
    trim: bool,
) -> Result<()>

pub fn rearrange<R: Read, W: Write>(
    keys: Vec<Keys>,
    read_buffer: &mut R,
    write_buffer: &mut W,
    range_start: usize,
    range_span: Option<usize>,
) -> Result<()>

Documentation

To learn more about Crypt4GH, see the official documentation.

Troubleshooting

To build from source on Windows, you should first have installed the MSVC Build Tools.

Versions

Find the latest versions by id

Information - Updated Jul 30, 2022

Stars: 3
Forks: 1
Issues: 0

Orion is a cryptography library written in pure Rust

It aims to provide easy and usable crypto while trying to minimize the use of unsafe code

Orion is a cryptography library written in pure Rust

Rustls is a modern TLS library written in Rust

ring for cryptography and rustls-pemfile crate

Rustls is a modern TLS library written in Rust

Mundane is a Rust cryptography library backed by BoringSSL that is difficult

to misuse, ergonomic, and performant (in that order)

Mundane is a Rust cryptography library backed by BoringSSL that is difficult

Rustls is a modern TLS library written in Rust

ring for cryptography and rustls-pemfile crate

Rustls is a modern TLS library written in Rust

This repository holds a Rust port of Google's Tink cryptography library

This repository holds a Rust port of Google's RustCrypto crates – this repo focuses on making

This repository holds a Rust port of Google's Tink cryptography library

A cryptography library that is mainly implemented in Rust

I aim to implement bindings to other languages such as C/C++ and Python

A cryptography library that is mainly implemented in Rust

Created for Cryptography Class, Spring 2019

RSA works on both Linux And Windows

Created for Cryptography Class, Spring 2019

A collection of cryptography functions written in Rust

rustup -- curl --proto '=https' --tlsv1

A collection of cryptography functions written in Rust

The SIDH-RS library is an efficient supersingular isogeny-based cryptography library written in Rust language

The library includes the ephemeral Diffie-Hellman key exchange (SIDH) as described in [1,2]

The SIDH-RS library is an efficient supersingular isogeny-based cryptography library written in Rust language

To use this library, you can either use one of the provided finite fields, or...

Gridiron Cryptography Services team has conducted an audit of this library - release

To use this library, you can either use one of the provided finite fields, or...

Cryptography Final Project

This is a simple implementation of textbook RSA done for my MTH 330: Cryptography final project

Cryptography Final Project
Facebook Instagram Twitter GitHub Dribbble
Privacy