#elliptic-curve #scheme #integrated #encryption #ecies #pure

cyfs-ecies

Elliptic Curve Integrated Encryption Scheme for secp256k1 in Rust

1 unstable release

0.1.4 Jun 1, 2022

#6 in #ecies

Download history 33/week @ 2024-07-22 48/week @ 2024-07-29 44/week @ 2024-08-05 27/week @ 2024-08-12 25/week @ 2024-08-19 74/week @ 2024-08-26 26/week @ 2024-09-02 23/week @ 2024-09-09 30/week @ 2024-09-16 49/week @ 2024-09-23 22/week @ 2024-09-30 1/week @ 2024-10-07 36/week @ 2024-10-14 12/week @ 2024-10-21 18/week @ 2024-10-28 33/week @ 2024-11-04

99 downloads per month
Used in 16 crates (via cyfs-base)

MIT license

16KB
272 lines

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

Dependencies

~3MB
~50K SLoC