@knfs-tech/dsa
v1.0.0
Published
Digital Signature Authentication module
Downloads
2
Readme
This npm package provides Digital Signature Authentication module for various security measures.
Install
Install the package via npm:
npm install @knfs-tech/dsa
Or via yarn:
yarn add @knfs-tech/dsa
Usage
const { init, generateKeys, createSign, verifySign } = require('@knfs-tech/dsa').dsa;
// Initialize DSA configuration
init({ modulusLength: 4096, storageLocalPath: '/path/to/keys' });
// Generate public and private keys
const { publicKey, privateKey } = generateKeys('example');
// Create a digital signature
const dataToSign = 'Hello, world!';
const signature = createSign(dataToSign, privateKey);
// Verify a digital signature
const verifyData = { data: dataToSign, signature };
const isVerified = verifySign(verifyData, publicKey);
console.log('Signature verified:', isVerified);
License
DSA is open-sourced software licensed under the MIT license.