Socket
Socket
Sign inDemoInstall

@ocap/mcrypto

Package Overview
Dependencies
44
Maintainers
3
Versions
421
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ocap/mcrypto

Crypto lib that provides signer,crypter,hasher interface


Version published
Maintainers
3
Created

Readme

Source

mcrypto:js

styled with prettier docs Gitter

Forge mcrypto implementation for javascript, just a wrapper around existing javascript crypto libraries.

Usage

npm i @ocap/mcrypto -S
# OR
yarn add @ocap/mcrypto

Sign/Verify

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

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

Implementation

Hasher

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

Signer

  • ed25519: tweetnacl
  • secp256k1: elliptic

Crypter

  • aes-cbc-256: crypto-js

Keywords

FAQs

Last updated on 09 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc