
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
这是一个构建与pki.js之上的,用于处理公钥,私钥,证书,签名等基础设施的简单工具包。
npm install @vf.js/pki
import {
generateKeypairPem,
pemToPrivateKey,
pemToPublicKey,
certificationRequest,
utf8tob64
} from "@vf.js/pki"
// 创建Pem格式的密钥对
const keypairPem = generateKeypairPem({ "alg": 'EC', "curve": "secp256r1" })
console.log(keypairPem.privateKeyPem)
console.log(keypairPem.publicKeyPem)
// 获取原生的密钥信息
const privateKey = await pemToPrivateKey(keypairPem.privateKeyPem);
const publicKey = await pemToPublicKey(keypairPem.publicKeyPem);
// 创建CSR证书请求
const csr = await certificationRequest(privateKey,publicKey,[
{
name: 'commonName',
value: 'www.example.com'
},
{
name: 'countryName',
value: 'China'
},
{
name: 'stateOrProvinceName',
value: 'BeiJing'
},
{
name: 'localityName',
value: 'BeiJing'
},
{
name: 'organizationName',
value: 'Huawei'
},
{
name: 'organizationalUnitName',
value: 'client'
},
])
console.log(csr.csrPem)
import { xxxxx } from "@vf.js/pki"
const keypairPem = await generateKeypairPem({ "alg": 'EC', "curve": "secp256r1" })
console.log(keypairPem.privateKeyPem)
console.log(keypairPem.publicKeyPem)
DefaultAlgorithm =
{
name: "ECDSA", // ✅ 正确的算法名称
hash: "SHA-256", // ECDSA 必须指定哈希算法,比如 SHA-256
namedCurve: "P-256", // 指定椭圆曲线,比如 P-256, P-384, P-521
};
import { certToPublicPem } from "@vf.js/pki"
const pubPem = await certToPublicPem(certStrPem)
await pemToArrayBuffer(pemStr);
const pem = await arrayBufferToPem(signature,'CERTIFICATE REQUEST');
await pemToASN1(pemStr)
await pemToPrivateKey(pem: string, keyUsages?: KeyUsage[], keyFormat?: "pkcs8" | "raw")
await pemToPublicKey(publicKeyPem)
查看示例
certificationRequest
getCrypto
b64toutf8
utf8tob64
FAQs
这是一个构建与pki.js之上的,用于处理公钥,私钥,证书,签名等基础设施的简单工具包。
We found that @vf.js/pki demonstrated a healthy version release cadence and project activity because the last version was released less than 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 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.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.