# @arcblock/mcrypto

> Crypto lib that provides signer,crypter,hasher interface

Latest version **1.8.0** (published 2025-08-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @arcblock/mcrypto
pnpm add @arcblock/mcrypto
yarn add @arcblock/mcrypto
bun add @arcblock/mcrypto
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.8.0 |
| Published | 2025-08-05 |
| First published | 2019-02-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 26 |
| Author | wangshijun |
| Maintainers | wangshijun, polunzh, mave99a, gxw |
| Keywords | crypto, forge, arcblock, blockchain, sdk |

## Links

- npm: https://www.npmjs.com/package/@arcblock/mcrypto
- Repository: https://github.com/ArcBlock/forge-js
- Homepage: https://github.com/ArcBlock/forge-js/tree/master/forge/mcrypto
- Issues: https://github.com/ArcBlock/forge-js/issues
- npm.io page: https://npm.io/package/@arcblock/mcrypto

## Dependencies (9)

- [bn.js](https://npm.io/package/bn.js.md) 5.1.3
- [hash.js](https://npm.io/package/hash.js.md) ^1.1.7
- [js-sha3](https://npm.io/package/js-sha3.md) ^0.8.0
- [elliptic](https://npm.io/package/elliptic.md) ^6.5.4
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1
- [interface](https://npm.io/package/interface.md) ^1.2.1
- [tweetnacl](https://npm.io/package/tweetnacl.md) ^1.0.3
- [randombytes](https://npm.io/package/randombytes.md) ^2.1.0
- [@arcblock/forge-util](https://npm.io/package/@arcblock/forge-util.md) 1.8.0

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.8.0 (latest) — 2025-08-05
- 1.7.1 — 2022-09-07
- 1.7.0 — 2022-09-07
- 1.6.3 — 2021-04-21
- 1.6.2 — 2021-03-17
- 1.6.1 — 2021-03-12
- 1.6.0 — 2021-03-04
- 1.5.8 — 2021-01-19
- 1.5.7 — 2021-01-18
- 1.5.6 — 2021-01-14
- 1.5.5 — 2020-12-31
- 1.5.4 — 2020-12-31
- 1.5.3 — 2020-12-29
- 1.5.2 — 2020-12-27
- 1.5.1 — 2020-12-23
- … 89 more at https://npm.io/package/@arcblock/mcrypto/versions

## README

![mcrypto:js](https://www.arcblock.io/.netlify/functions/badge/?text=mcrypto:js)

[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![docs](https://img.shields.io/badge/powered%20by-arcblock-green.svg)](https://docs.arcblock.io)
[![Gitter](https://badges.gitter.im/ArcBlock/community.svg)](https://gitter.im/ArcBlock/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

> Forge [mcrypto](https://github.com/ArcBlock/mcrypto) implementation for javascript, just a wrapper around existing javascript crypto libraries.


## Usage

```shell
npm i @arcblock/mcrypto -S
# OR
yarn add @arcblock/mcrypto
```

### Sign/Verify

```javascript
const { Signer } = require('@arcblock/mcrypto');

const keyPair = Signer.Ed25519.genKeyPair();
const message = 'some message to sign';
const signature = Signer.Ed25519.sign(message, keyPair.secretKey);
const result = Signer.Ed25519.verify(message, signature, keyPair.publicKey);
assert.ok(result);
```

### Hashing

```javascript
const { Hasher } = require('@arcblock/mcrypto');

const message = 'message to hash';
const hash = Hasher.SHA2.hash256(message);
```


## Documentation

For full documentation, checkout [https://forge-js.netlify.com](https://forge-js.netlify.com/)


## Implementation

### Hasher

* keccakf1600: js-sha3
* sha2: hash.js
* sha3: js-sha3

### Signer

* [`ed25519`](https://github.com/ArcBlock/forge-js/commit/ed25519): tweetnacl
* secp256k1: elliptic

### Crypter

* aes-cbc-256: crypto-js

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