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

cyfs-ecies

Elliptic Curve Integrated Encryption Scheme for secp256k1 in Rust

1 unstable release

0.1.4 Jun 1, 2022

#1967 in Cryptography

Download history 21/week @ 2023-12-01 22/week @ 2023-12-08 36/week @ 2023-12-15 49/week @ 2023-12-22 4/week @ 2023-12-29 30/week @ 2024-01-05 43/week @ 2024-01-12 22/week @ 2024-01-19 15/week @ 2024-01-26 22/week @ 2024-02-02 31/week @ 2024-02-09 55/week @ 2024-02-16 40/week @ 2024-02-23 83/week @ 2024-03-01 61/week @ 2024-03-08 46/week @ 2024-03-15

241 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

~1.5MB
~25K SLoC