All Projects → ecies → js

ecies / js

Licence: MIT license
Elliptic Curve Integrated Encryption Scheme for secp256k1 in TypeScript

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to js

go
Elliptic Curve Integrated Encryption Scheme for secp256k1 in Golang
Stars: ✭ 56 (-12.5%)
Mutual labels:  ecies, secp256k1, elliptic-curve-cryptography
py
Elliptic Curve Integrated Encryption Scheme for secp256k1 in Python
Stars: ✭ 97 (+51.56%)
Mutual labels:  ecies, secp256k1, elliptic-curve-cryptography
noble-secp256k1
Fastest JS implementation of secp256k1. Independently audited, high-security, 0-dependency ECDSA & Schnorr signatures.
Stars: ✭ 313 (+389.06%)
Mutual labels:  secp256k1, elliptic-curve-cryptography
go-secp256k1
Go wrapper for the C secp256k1 library
Stars: ✭ 16 (-75%)
Mutual labels:  secp256k1
BitCrack2
Brute force Bitcoin private keys.
Stars: ✭ 30 (-53.12%)
Mutual labels:  secp256k1
oxo-chat-client
基于websocket、json、blockchain的公告、聊天(客户端到客户端加密)客户端。账号无需注册,本地生成!
Stars: ✭ 52 (-18.75%)
Mutual labels:  secp256k1
std-curves
Standard curve database.
Stars: ✭ 53 (-17.19%)
Mutual labels:  elliptic-curve-cryptography
secp256k1-php
PHP bindings for bitcoin-core/secp256k1
Stars: ✭ 55 (-14.06%)
Mutual labels:  secp256k1
dusk-zerocaf
Zerocaf: A library built for EC operations in Zero Knowledge.
Stars: ✭ 50 (-21.87%)
Mutual labels:  elliptic-curve-cryptography
EllipticCurve
An elliptic curve library written in Swift 4
Stars: ✭ 18 (-71.87%)
Mutual labels:  secp256k1
lds-ecdsa-secp256k1-2019.js
EcdsaSecp256k1Signature2019 JSON-LD Signature Suite
Stars: ✭ 15 (-76.56%)
Mutual labels:  secp256k1
ECDSA secp256k1 JordonMatrix nodejs
javascript ecdsa generator, specifically secp256k1 properties, using jordon form matrices
Stars: ✭ 15 (-76.56%)
Mutual labels:  secp256k1
bp
Bitcoin Protocol components in Common Lisp
Stars: ✭ 28 (-56.25%)
Mutual labels:  secp256k1
leptin
🔗 Leptin is a PoW blockchain completely built in Nodejs.
Stars: ✭ 57 (-10.94%)
Mutual labels:  secp256k1
tiny-secp256k1
A tiny secp256k1 native/JS wrapper
Stars: ✭ 41 (-35.94%)
Mutual labels:  secp256k1
ecdsa-kotlin
A simple, yet lightweight, fast elliptical curve cryptography library in kotlin.
Stars: ✭ 24 (-62.5%)
Mutual labels:  secp256k1
secp256k1.cr
a native library implementing secp256k1 purely for the crystal language.
Stars: ✭ 34 (-46.87%)
Mutual labels:  secp256k1
Cryptography.ECDSA
secp256k1 algorythm
Stars: ✭ 34 (-46.87%)
Mutual labels:  secp256k1
oxo-chat-app
基于websocket、json、blockchain的公告、聊天(客户端到客户端加密)客户端。账号无需注册,本地生成!
Stars: ✭ 20 (-68.75%)
Mutual labels:  secp256k1
secp256k1-ml
Elliptic curve library secp256k1 wrapper for Ocaml
Stars: ✭ 18 (-71.87%)
Mutual labels:  secp256k1

eciesjs

Codacy Badge License Npm Package CI Codecov

Elliptic Curve Integrated Encryption Scheme for secp256k1 in TypeScript.

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

If you want a WASM version to run directly in modern browsers or on some blockchains, check ecies-wasm.

Install

npm install eciesjs

Quick Start

Run the code below with npx ts-node.

> import { encrypt, decrypt, PrivateKey } from 'eciesjs'
> const k1 = new PrivateKey()
> const data = Buffer.from('this is a test')
> decrypt(k1.toHex(), encrypt(k1.publicKey.toHex(), data)).toString()
'this is a test'

API

encrypt(receiverRawPK: string | Buffer, msg: Buffer): Buffer

Parameters:

  • receiverRawPK - Receiver's secp256k1 public key, hex string or buffer
  • msg - Data to encrypt

Returns: Buffer

decrypt(receiverRawSK: string | Buffer, msg: Buffer): Buffer

Parameters:

  • receiverRawSK - Receiver's secp256k1 private key, hex string or buffer
  • msg - Data to decrypt

Returns: Buffer

PrivateKey

  • Methods
static fromHex(hex: string): PrivateKey;
constructor(secret?: Buffer);
toHex(): string;
encapsulate(pub: PublicKey): Buffer;
multiply(pub: PublicKey): Buffer;
equals(other: PrivateKey): boolean;
  • Properties
readonly secret: Buffer;
readonly publicKey: PublicKey;

PublicKey

  • Methods
static fromHex(hex: string): PublicKey;
constructor(buffer: Buffer);
toHex(compressed?: boolean): string;
decapsulate(priv: PrivateKey): Buffer;
equals(other: PublicKey): boolean;
  • Properties
readonly uncompressed: Buffer;
readonly compressed: Buffer;

Release Notes

0.3.1 ~ 0.3.15

  • Support Node 18
  • Drop Node 10, 12 support
  • Bump dependencies
  • Update documentation
  • Extract constant variables and rename some parameters

0.3.0

  • API change: encrypt/decrypt now can take both hex string and Buffer

0.2.0

  • API change: use HKDF-sha256 to derive shared keys instead of sha256
  • Bump dependencies
  • Update documentation

0.1.1 ~ 0.1.5

  • Bump dependencies
  • Update documentation

0.1.0

  • First beta version release
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].