![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@hearro/didcomm
Advanced tools
Javascript (written in typescript) version of the cryptographic envelope of DIDComm. This library is built for any javascript environment that needs to . It is built on libsodium-js and follows the specs documented in the docs folder.
This package is currently not available on NPM: It will be added to npm under the package name DIDComm-crypto-js
when a CI/CD platform can be added to publish it.
NOTE THESE APIs are currently unstable at this point to account for new non-repudiable signing changes
There's currently 4 APIs of use in this library that will handle encryption and decryption to multiple recipients. Messages encrypted with this library support repudiable authentication and anonymous encryption. There's additional APIs to support non-repudiable signing and verification of messages.
pack_auth_msg_for_recipients(message, recipientKeyList, senderKeyPair, nonRepudiable = false) should be the default method used. This example shows how to use repudiable authentication to pack a message for the recipient.
const didcomm = new DIDComm()
await didcomm.Ready
const alice = await didcomm.generateKeyPair()
const bob = await didcomm.generateKeyPair()
const message = 'I AM A PRIVATE MESSAGE'
const packedMsg = await didcomm.pack_auth_msg_for_recipients(message, [bob.publicKey], alice)
const unpackedMsg = await didcomm.unpackMessage(packedMsg, bob)
To Encrypt a message for a recipient and sign the message using a non-repudiable signature change the nonRepudiable variable should be set to true
. To understand what non-repudiation is and when it should be used refer here.
const didcomm = new DIDComm()
await didcomm.Ready
const alice = await didcomm.generateKeyPair()
const bob = await didcomm.generateKeyPair()
const message = 'I AM A PRIVATE MESSAGE'
const packedMsg = await didcomm.pack_auth_msg_for_recipients(message, [bob.publicKey], alice, true)
const unpackedMsg = await didcomm.unpackMessage(packedMsg, bob)
For privacy reasons or to meet the principle of least information, it may be necessary to encrypt a message, but does not provide authentication guarantees.
const didcomm = new DIDComm()
await didcomm.Ready
const bob = await didcomm.generateKeyPair()
const message = JSON.stringify({
"@type": "did:example:1234567890;spec/test",
data: "I AM A SIGNED MESSAGE"
})
const packedMsg = await didcomm.pack_anon_msg_for_recipients(message, [bob.publicKey])
const unpackedMsg = await didcomm.unpackMessage(packedMsg, bob)
In very specific use cases like the invitation protocol or incredibly short lived connection (1 round trip only) it's necessary to provide data in a plaintext format to provide a key. In these cases we will sign the data, but leave it unencrypted.
const didcomm = new DIDComm()
await didcomm.Ready
const bob = await didcomm.generateKeyPair()
const message = "I AM A PUBLIC MESSAGE"
const packedMsg = await didcomm.pack_nonrepudiable_msg_for_anyone(message, bob)
const unpackedMsg = await didcomm.unpackMessage(packedMsg, bob)
To perform authentication this library should be combined with resolution of a DID Document to ensure the key used by the sender is contained in a valid DID Document. This funcationality is considered out of scope for this library.
FAQs
Cryptographic envelope layer of DIDComm written in Typescript
The npm package @hearro/didcomm receives a total of 11 weekly downloads. As such, @hearro/didcomm popularity was classified as not popular.
We found that @hearro/didcomm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.