
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@libp2p/keychain
Advanced tools
Key management and cryptographically protected messages
The key management and naming service API all return a KeyInfo
object. The id
is a universally unique identifier for the key. The name
is local to the key chain.
{
"name": "rsa-key",
"id": "QmYWYSUZ4PV6MRFYpdtEDJBiGs4UrmE6g8wmAWSePekXVW"
}
The key id is the SHA-256 multihash of its public key.
The public key is a protobuf encoding containing a type and the DER encoding of the PKCS SubjectPublicKeyInfo.
A private key is stored as an encrypted PKCS 8 structure in the PEM format. It is protected by a key generated from the key chain's pass phrase using PBKDF2.
The default options for generating the derived encryption key are in the dek
object. This, along with the pass phrase, is the input to a PBKDF2
function.
const defaultOptions = {
// See https://cryptosense.com/parameter-choice-for-pbkdf2/
dek: {
keyLength: 512 / 8,
iterationCount: 1000,
salt: 'at least 16 characters long',
hash: 'sha2-512'
}
}
The actual physical storage of an encrypted key is left to implementations of interface-datastore.
A key benefit is that now the key chain can be used in browser with the js-datastore-level implementation.
$ npm i @libp2p/keychain
<script>
tagLoading this module through a script tag will make its exports available as Libp2pKeychain
in the global namespace.
<script src="https://unpkg.com/@libp2p/keychain/dist/index.min.js"></script>
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
FAQs
Key management and cryptographically protected messages
The npm package @libp2p/keychain receives a total of 8,631 weekly downloads. As such, @libp2p/keychain popularity was classified as popular.
We found that @libp2p/keychain demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.