Socket
Book a DemoInstallSign in
Socket

@fresh-js/crypto

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@fresh-js/crypto

:warning: _This package is a work in progress and has not yet been vetted for production use._

0.0.7
unpublished
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Fresh Crypto

:warning: This package is a work in progress and has not yet been vetted for production use.

The @fresh-js/crypto package provides JavaScript cryptographic utilities needed to manage keys, sign transactions and verify signatures for the Flow blockchain.

Functionality

Currently this package only supports ECDSA key generation and signing on the NIST P-256 and secp25k1 curves, using either SHA2 or SHA3 hashing.

Install

npm i @fresh-js/crypto

Usage Examples

Sign a message

Sign a message with a P-256 private key and SHA3 hashing:

import { HashAlgorithm, InMemoryECPrivateKey, InMemoryECSigner, SignatureAlgorithm } from '@fresh-js/crypto';

const PRIVATE_KEY_HEX = 'xxxx';
  
const privateKey = InMemoryECPrivateKey.fromHex(PRIVATE_KEY_HEX, SignatureAlgorithm.ECDSA_P256);
const signer = new InMemoryECSigner(privateKey, HashAlgorithm.SHA3_256);

const message = Buffer.from("deadbeef", "hex");

const signature = signer.sign(message);

FAQs

Package last updated on 17 Aug 2022

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.