
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@peculiar/asn1-cms
Advanced tools
@peculiar/asn1-cms is a JavaScript library for handling ASN.1 structures related to Cryptographic Message Syntax (CMS). It provides tools for encoding and decoding CMS data structures, which are used in secure messaging and data encryption applications.
Encoding CMS Structures
This feature allows you to encode CMS structures into ASN.1 BER format. The code sample demonstrates creating a ContentInfo object with a simple data content type and encoding it to a binary format.
const { ContentInfo } = require('@peculiar/asn1-cms');
const contentInfo = new ContentInfo({
contentType: '1.2.840.113549.1.7.1', // data
content: Buffer.from('Hello, World!')
});
const encoded = contentInfo.toSchema().toBER();
console.log(encoded);
Decoding CMS Structures
This feature allows you to decode ASN.1 BER encoded CMS structures. The code sample shows how to decode a binary encoded ContentInfo object and access its content type and content.
const { ContentInfo } = require('@peculiar/asn1-cms');
const encodedData = new Uint8Array([/* some encoded data */]);
const contentInfo = ContentInfo.fromBER(encodedData.buffer);
console.log(contentInfo.contentType);
console.log(contentInfo.content);
asn1js is a library for encoding and decoding ASN.1 data structures in JavaScript. It provides a more general-purpose ASN.1 handling capability compared to @peculiar/asn1-cms, which is specifically focused on CMS structures.
pkijs is a library for working with Public Key Infrastructure (PKI) in JavaScript. It includes support for CMS, but also provides broader functionality for handling certificates, CRLs, and other PKI-related structures. It is more comprehensive than @peculiar/asn1-cms, which is focused solely on CMS.
FAQs
ASN.1 schema of `Cryptographic Message Syntax (CMS)` (RFC5652)
We found that @peculiar/asn1-cms demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.