cyfs-ecies

Crates.iocyfs-ecies
lib.rscyfs-ecies
version0.1.4
sourcesrc
created_at2022-06-01 08:37:49.505223
updated_at2022-06-01 08:37:49.505223
descriptionElliptic Curve Integrated Encryption Scheme for secp256k1 in Rust
homepagehttps://github.com/ecies/rs
repositoryhttps://github.com/ecies/rs
max_upload_size
id598044
size16,967
CYFS Core Dev (BDTDevTeam)

documentation

https://github.com/ecies/rs

README

eciesrs

Codacy Badge License Circle CI Crates

Elliptic Curve Integrated Encryption Scheme for secp256k1 in Rust, based on pure Rust implementation of secp256k1.

This is the Rust version of eciespy.

API

pub fn encrypt(receiver_pub: &[u8], msg: &[u8]) -> Result<Vec<u8>, SecpError>
pub fn decrypt(receiver_sec: &[u8], msg: &[u8]) -> Result<Vec<u8>, SecpError>

Quick Start

const MSG: &str = "helloworld";
let (sk, pk) = generate_keypair();
let (sk, pk) = (&sk.serialize(), &pk.serialize());

let msg = MSG.as_bytes();
assert_eq!(
    msg,
    decrypt(sk, &encrypt(pk, msg).unwrap()).unwrap().as_slice()
);

Release Notes

0.1.1 ~ 0.1.4

  • Bump dependencies
  • Update documentation
  • Fix error handling

0.1.0

  • First beta version release
Commit count: 83

cargo fmt