# @ocap/mcrypto

> Crypto lib that provides signer,crypter,hasher interface

Latest version **1.30.24** (published 2026-05-14) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.30.24 |
| Published | 2026-05-14 |
| First published | 2021-03-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 144.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wangshijun |
| Maintainers | wangshijun, polunzh, mave99a |
| Keywords | crypto, arcblock, blockchain, sdk |

## Links

- npm: https://www.npmjs.com/package/@ocap/mcrypto
- Repository: https://github.com/ArcBlock/blockchain
- Homepage: https://github.com/ArcBlock/blockchain/tree/master/core/mcrypto
- Issues: https://github.com/ArcBlock/blockchain/issues
- npm.io page: https://npm.io/package/@ocap/mcrypto

## Dependencies (7)

- [crypto-js](https://npm.io/package/crypto-js.md) ^4.2.0
- [interface](https://npm.io/package/interface.md) ^1.2.1
- [@ocap/util](https://npm.io/package/@ocap/util.md) 1.30.24
- [randombytes](https://npm.io/package/randombytes.md) ^2.1.0
- [@noble/curves](https://npm.io/package/@noble/curves.md) ^2.2.0
- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^2.2.0
- [@noble/ed25519](https://npm.io/package/@noble/ed25519.md) ^3.0.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.30.24 (latest) — 2026-05-14
- 1.18.40-beta.6 (next) — 2023-02-14
- 1.30.23 — 2026-05-13
- 1.30.22 — 2026-05-13
- 1.30.21 — 2026-05-12
- 1.30.20 — 2026-05-12
- 1.30.19 — 2026-05-12
- 1.30.18 — 2026-05-11
- 1.30.17 — 2026-05-11
- 1.30.16 — 2026-05-10
- 1.30.15 — 2026-05-08
- 1.30.14 — 2026-05-08
- 1.30.13 — 2026-05-08
- 1.30.12 — 2026-05-05
- 1.30.11 — 2026-05-03
- … 605 more at https://npm.io/package/@ocap/mcrypto/versions

## README

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

[![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 @ocap/mcrypto -S
# OR
bun install @ocap/mcrypto
```

### Sign/Verify

```javascript
const { Signer } = require('@ocap/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('@ocap/mcrypto');

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

## Documentation

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

## Implementation

### Hasher

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

### Signer

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

### Crypter

- aes-cbc-256: crypto-js

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