
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
libp2p-crypto-secp256k1
Advanced tools
Support for secp256k1 keys in js-libp2p-crypto
This repo contains a js-libp2p-crypto-compatible implementation of cryptographic signature generation and verification using the secp256k1 elliptic curve popularized by Bitcoin and other crypto currencies.
npm install --save libp2p-crypto-secp256k1
This module is designed to work with js-libp2p-crypto.
Installing libp2p-crypto-secp256k1 will automatically add support for the 'secp256k1' key type, which
can be used as an argument to the libp2p-crypto API functions
generateKeyPair, unmarshalPublicKey, and marshalPrivateKey. The keys returned from those functions will be
instances of the Secp256k1PublicKey or Secp256k1PrivateKey classes provided by this module.
const crypto = require('libp2p-crypto')
const msg = Buffer.from('Hello World')
const key = await crypto.generateKeyPair('secp256k1', 256)
// assuming no error, key will be an instance of Secp256k1PrivateKey
// the public key is available as key.public
const sig = await key.sign(msg)
const valid = await key.public.verify(msg, sig)
assert(valid, 'Something went horribly wrong')
The functions below are the public API of this module.
For usage within libp2p-crypto, see the libp2p-crypto API documentation.
generateKeyPair([bits])bits: Number - Optional, included for compatibility with js-libp2p-crypto. Ignored if present; private keys will always be 256 bits.Returns Promise<Secp256k1PrivateKey>
unmarshalSecp256k1PublicKey(bytes)bytes: BufferConverts a serialized secp256k1 public key into an instance of Secp256k1PublicKey and returns it
unmarshalSecp256k1PrivateKey(bytes)bytes: BufferReturns Promise<Secp256k1PrivateKey>
Converts a serialized secp256k1 private key into an instance of Secp256k1PrivateKey.
Secp256k1PublicKey.verify(data, sig)data: Buffersig: BufferReturns Promise<Boolean>
Calculates the SHA-256 hash of data, and verifies the DER-encoded signature in sig.
Secp256k1PrivateKey.publicAccessor for the Secp256k1PublicKey associated with this private key.
.sign(data)data: BufferReturns Promise<Buffer>
Calculates the SHA-256 hash of data and signs it, resolves with the DER-encoded signature.
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.
FAQs
Support for secp256k1 keys in libp2p-crypto
The npm package libp2p-crypto-secp256k1 receives a total of 16,527 weekly downloads. As such, libp2p-crypto-secp256k1 popularity was classified as popular.
We found that libp2p-crypto-secp256k1 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.

Research
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.