
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@bicycle-codes/message
Advanced tools
Create and verify signed messages with the webcrypto API.
npm i -S @bicycle-codes/message
import { Keys } from '@bicycle-codes/keys'
import { create } from '@bicycle-codes/message'
const alicesKeys = await Keys.create()
const req = await create(alicesKeys, { hello: 'world' })
The returned object has a format like
{
author: 'did:key:...',
signature: '123abc',
...message
}
[!NOTE]
The message will have the fieldsauthorandsignatureappended to it.authoris the DID that was used to sign this message. It is read byverify(message).
import { test } from '@substrate-system/tapzero'
import { Keys } from '@bicycle-codes/keys'
import { create } from '@bicycle-codes/message'
let req:SignedMessage<{ hello: 'world' }>
const alicesKeys = await Keys.create()
test('create a message', async t => {
req = await create(alicesKeys, { hello: 'world' })
t.ok(req, 'request was created')
t.equal(typeof req.signature, 'string', 'should have a signature')
t.ok(req.author.includes('did:key:'), 'should have an author field')
t.equal(req.hello, 'world', 'should have the properties we passed in')
})
import { test } from '@nichoth/tapzero'
import { verify } from '@bicycle-codes/message'
test('verify a message', async t => {
// `req` is the message we created above
const isOk = await verify(req)
t.equal(isOk, true, 'should return true for a valid message')
})
FAQs
Create and verify signed messages
We found that @bicycle-codes/message demonstrated a healthy version release cadence and project activity because the last version was released less than 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.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.