UNPKG

crypto-keygen-suite

Version:

Key generation utilities for cryptographic operations. YES I RENAMED IT. SIX STATE PROTOCOL!!! See its folder for all <3

22 lines (19 loc) 574 B
import crypto from 'crypto'; import { format } from 'path'; function generateDSAKeyPair() { const { publicKey, privateKey } = crypto.generateKeyPairSync('dsa', { modulusLength: 2048, publicKeyEncoding: { type: 'spki', format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', }, }); return { publicKey, privateKey }; } const { publicKey, privateKey } = generateDSAKeyPair(); console.log(`Generated DSA Public Key:\n${publicKey}`); console.log(`Generated DSA Private Key:\n${privateKey}`);