
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@hivechain/libcrypto
Advanced tools
A small vendoring wrapper for sjcl with support for hashes and encodings required by the Hive platform.
If you are using Webpack or Browserify, you must ensure that Node's built-in crypto package
is excluded from your builds.
Otherwise, just
$ yarn install @hivechain/libcrypto
> crypto = require('@hivechain/libcrypto');
Hashes the content of an ArrayBuffer using SHA-256.
> shaHash = crypto.sha256(new Uint8Array().buffer)
ArrayBuffer { byteLength: 32 }
> crypto.hexify(shaHash)
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
Hashes the content of an ArrayBuffer using RIPEMD-160.
> ripemdHash = crypto.ripemd160(new Uint8Array().buffer)
ArrayBuffer { byteLength: 20 }
> crypto.hexify(ripemdHash)
'9c1185a5c5e9fc54612808977ee8f548b2258d31'
Provides operations over Hive secp256k1-based ECC private keys.
> secretKey = crypto.PrivateKey.from('5JCDRqLdyX4W7tscyzyxav8EaqABSVAWLvfi7rdqMKJneqqwQGt')
PrivateKey { getPublicKey: [Function], sign: [Function] }
> secretKey.getPublicKey().toString()
'STM5pZ15FDVAvNKW3saTJchWmSSmYtEvA6aKiXwDtCq2JRZV9KtR9'
> secretSig = secretKey.sign(new Uint8Array(32).buffer)
ArrayBuffer { byteLength: 65 }
> crypto.hexify(secretSig)
'20387d5f9ae215a64065fde2a9d4f7be83d3480b7cc89f7c01488042da348845408909e9d4f1d66466c53f0007c771a73bf2883d8d5ab4735b5b4316091361442c'
Provides operations over Hive secp256k1-based ECC public keys.
> publicKey = crypto.PublicKey.from('STM5SKxjN1YdrFLgoPcp9KteUmNVdgE8DpTPC9sF6jbjVqP9d2Utq')
...
> publicKey.verify(new Uint8Array(32).buffer, secretSig)
true
> PublicKey.recover(someHash, someSig)
...
Generates a new pair of keys in Hive WIF format using cryptographically secure random number generation.
> crypto.generateKeys()
{
private: "5JCDRqLdyX4W7tscyzyxav8EaqABSVAWLvfi7rdqMKJneqqwQGt",
public: "STM5pZ15FDVAvNKW3saTJchWmSSmYtEvA6aKiXwDtCq2JRZV9KtR9"
}
Given a Hive account name and password, regenerates the derived owner, posting,
active, and memo keys.
> crypto.keysFromPassword('username', 'password')
{ owner:
{ private: '5JCDRqLdyX4W7tscyzyxav8EaqABSVAWLvfi7rdqMKJneqqwQGt',
public: 'STM5pZ15FDVAvNKW3saTJchWmSSmYtEvA6aKiXwDtCq2JRZV9KtR9' },
memo:
{ private: '5JSmQQJXH5ZrSW3KJSTUPFJy7SuLeDiY3bW6vB1McamxzJQFhwD',
public: 'STM5nwJgD9jmkAdTXuiz3jqrkw3om95gCapZo4e4Bcp3qzyiedwCn' },
posting:
{ private: '5HsoxWiHRRyx6oSxKj32HDqDMzSGhs79zLZopDc7nMcjMbcPp5E',
public: 'STM6gZmazY23TEMkxmPpnmvbAgWFAzwtaSDbhSUdmpTXzoJJLPFH4' },
active:
{ private: '5JamTPvZyQsHf8c2pbN92F1gUY3sJkpW3ZJFzdmfbAJPAXT5aw3',
public: 'STM5SKxjN1YdrFLgoPcp9KteUmNVdgE8DpTPC9sF6jbjVqP9d2Utq' } }
libcrypto is written in Javascript as specified by ECMA-262, version 5.1. Other than its vendored copy of sjcl, it has no dependencies and never will.
libcrypto explicitly supports the following environments without polyfills:
libcrypto explicitly does not support the following environments:
Contributions must conform to the following rules:
FAQs
Common javascript cryptographic utilities. Based on sjcl.
We found that @hivechain/libcrypto 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.