Skip to content

keepsimple1/libaes-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libaes-utils

Utils using libaes

Encrypt and decrypt using libaes

USAGE:
    libaes-utils [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    decrypt    AES 128 decrypt in CBC mode, decrypt -h for more details
    encrypt    AES 128 encrypt in CBC mode, encrypt -h for more details
    help       Prints this message or the help of the given subcommand(s)

Encrypt:

$ target/debug/libaes-utils encrypt -h
libaes-utils-encrypt
AES 128 encrypt in CBC mode, encrypt -h for more details

USAGE:
    libaes-utils encrypt [OPTIONS] -i <iv> -k <key> -m <message>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f <file>           file name to write cipher text
    -i <iv>             must be 16 characters
    -k <key>            must be 16 characters
    -m <message>        plain text

Decrypt:

$ target/debug/libaes-utils decrypt -h
libaes-utils-decrypt
AES 128 decrypt in CBC mode, decrypt -h for more details

USAGE:
    libaes-utils decrypt -f <file> -i <iv> -k <key> -m <message>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f <file>           file name to read cipher text
    -i <iv>             must be 16 characters
    -k <key>            must be 16 characters
    -m <message>        Cipher text in BASE64

Benchmark

We run benchmark using criterion with libaes against RustCrypto crates aes + block-modes. The code is here.

The current result on MacBook Pro Mid-2015 with Rust 1.49, running cargo bench:

libaes 128 cbc encrypt  time:   [639.89 ns 641.24 ns 642.72 ns]
aes-block-modes 128 cbc encrypt
                        time:   [2.2069 us 2.2125 us 2.2193 us]

libaes 128 cbc decrypt  time:   [664.92 ns 679.57 ns 696.55 ns]
aes-block-modes 128 cbc decrypt
                        time:   [2.4734 us 2.4985 us 2.5264 us]

For AES-128 CBC mode, libaes is more than 300% faster than aes + block-modes.

About

Utils using libaes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages