1 unstable release

Uses old Rust 2015

0.1.0 Feb 7, 2018

#15 in #symmetric

MIT license

11KB
232 lines

Travis Build Status AppVeyor Status crates.io MIT licensed

ipcrypt was designed by Jean-Philippe Aumasson to encrypt IPv4 addresses with 16-byte keys, where the result is still an IPv4 address.

Derived from the implementation at: https://github.com/veorq/ipcrypt

The documentation for master is located at https://stbuehler.github.io/rustdocs/ipcrypt/ipcrypt/; released versions are documented at https://docs.rs/ipcrypt.


lib.rs:

ipcrypt was designed by Jean-Philippe Aumasson to encrypt IPv4 addresses with 16-byte keys, where the result is still an IPv4 address.

Derived from the implementation at: https://github.com/veorq/ipcrypt

As input and output this implementation takes various types representing a sequence of 4 bytes. u32 is interpreted as big endian (network order; for consistency with how IPv4 adresses are represented as u32).

This crate supports a no-std feature which removes support for Ipv4Addr (because it's not available in core).

Example

use std::net::Ipv4Addr;
let addr = "127.0.0.1".parse::<Ipv4Addr>().unwrap();
println!("{}", ipcrypt::encrypt(addr, b"some 16-byte key"));

No runtime deps

Features