hero5512 / eth-ecies

Java version of ethereum ecies realization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elliptic Curve Integrated Encryption Scheme for ethereum secp256k1 in Java.

This is the Java version of ethereum ecies with a built-in class-like secp256k1 API, you may go there for detailed documentation and learn the mechanism under the hood.

Quick start

String msg = "hello world";
ECKey key = ECKey.fromPrivate(new BigInteger("40726844782749937894834151007763016161820451265783099183065635627847362290970", 10));
byte[] cipher = ECIES.encrypt(key.getPubKeyPoint(), msg.getBytes(), null, null);
byte[] msgBytes = ECIES.decrypt(((BCECPrivateKey) acc.getPrivateKey()).getD(), cipher, null, acc.serializePublicKey());

About

Java version of ethereum ecies realization

License:GNU General Public License v3.0


Languages

Language:Java 100.0%