open-index/open-npm huggingface dataset:
npm package: @kusnadi/dsa-js
Description: Digital Signature Algorithm Node.js
Author: Kusnadi
Latest version: 1.0.4

## Digital Signature Algorithm (Node.js)

<!-- blank line -->
<br/>
<!-- blank line -->


**1. GENERATE DSA PARAM**

```
openssl dsaparam -out dsaparam.pem 2048
```

<!-- blank line -->
<br/>
<!-- blank line -->


**2. GENERATE DSA PRIVATE KEY**

_Without Encrypted Private Key_
```
openssl gendsa -out privatekey.pem dsaparam.pem
```

_With Encrypted Private Key_
```
openssl gendsa -aes256 -out privatekey.enc.pem dsaparam.pem
```

<!-- blank line -->
<br/>
<!-- blank line -->


**3. GENERATE DSA PUBLIC KEY**

_Without Encrypted Private Key_
```
openssl dsa -in privatekey.pem -pubout -out publickey.pem
```

_With Encrypted Private Key_
```
openssl dsa -in privatekey.enc.pem -pubout -out publickey.enc.pem
```

<!-- blank line -->
<br/>
<!-- blank line -->

**4. HOW TO USE THIS PACKAGE**

```
const DSA = require('@kusnadi/dsa-js');

const dsa = new DSA("sha256");

// Load Private And Public Key
// if Private Key not encrypted, leave blank the second param of loadPrivateKey
dsa.loadPrivateKey("./privatekey.enc.pem", "admin123");
dsa.loadPublicKey("./publickey.enc.pem");


let message = "hallo";

// Create Signture
let signature = dsa.createSignature(message);

// Check Signature
let isVerfified = dsa.verify(message, signature);

console.log(message, signature, isVerfified);
```

**REFERENSI**
[https://github.com/restuhaqza/digital-signature](https://github.com/restuhaqza/digital-signature)