# @types/eccrypto

> TypeScript definitions for eccrypto

Latest version **1.1.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/eccrypto
pnpm add @types/eccrypto
yarn add @types/eccrypto
bun add @types/eccrypto
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2023-11-07 |
| First published | 2019-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/eccrypto
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eccrypto
- npm.io page: https://npm.io/package/@types/eccrypto

## Dependencies (2)

- [@types/node](https://npm.io/package/@types/node.md) *
- [@types/expect](https://npm.io/package/@types/expect.md) ^1.20.4

## Recent versions

- 1.1.6 (latest) — 2023-11-07
- 1.1.3 (ts3.6) — 2021-07-08
- 1.1.2 (ts3.2) — 2020-10-16
- 1.1.1 (ts2.1) — 2019-11-06
- 1.1.5 — 2023-10-18
- 1.1.4 — 2023-09-23
- 1.1.0 — 2019-10-23

## README

# Installation
> `npm install --save @types/eccrypto`

# Summary
This package contains type definitions for eccrypto (https://github.com/bitchan/eccrypto).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eccrypto.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eccrypto/index.d.ts)
````ts
/// <reference types="node" />
export as namespace eccrypto;

// Generate a new valid private key. Will use crypto.randomBytes as source.
export function generatePrivate(): Buffer;

// Compute the public key for a given private key.
export function getPublic(privateKey: Buffer): Buffer;

// Compute the compressed public key for a given private key.
export function getPublicCompressed(privateKey: Buffer): Buffer;

// Create an ECDSA signature.
export function sign(key: Buffer, msg: Buffer): Promise<Buffer>;

// Verify an ECDSA signature.
export function verify(publicKey: Buffer, msg: Buffer, sig: Buffer): Promise<null>;

// Derive shared secret for given private and public keys.
export function derive(privateKeyA: Buffer, publicKeyB: Buffer): Promise<Buffer>;

// Input/output structure for ECIES operations.
export interface Ecies {
    iv: Buffer;
    ephemPublicKey: Buffer;
    ciphertext: Buffer;
    mac: Buffer;
}

// Encrypt message for given recepient's public key.
export function encrypt(
    publicKeyTo: Buffer,
    msg: Buffer,
    opts?: { iv?: Buffer | undefined; ephemPrivateKey?: Buffer | undefined },
): Promise<Ecies>;

// Decrypt message using given private key.
export function decrypt(privateKey: Buffer, opts: Ecies): Promise<Buffer>;

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
 * Dependencies: [@types/expect](https://npmjs.com/package/@types/expect), [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Random Nerd](https://github.com/randomnerd).

---
_Source: https://npm.io/package/@types/eccrypto · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
