SkillAgentSearch skills...

Elgamal.js

ElGamal cryptosystem for JavaScript.

Install / Use

/learn @kripod/Elgamal.js
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

elgamal.js

ElGamal cryptosystem for JavaScript based on the implementation of PyCrypto.

Version (npm) Build Status Code Coverage Gitter

Getting started

In order to access the provided cryptographic functions, an instance of ElGamal should be generated or initialized with custom parameters.

import ElGamal from 'elgamal';

const eg = await ElGamal.generateAsync(); // Recommended way of initialization
const egCustom = new ElGamal(prime, generator, publicKey, privateKey);

Encryption and decryption

const secret = 'The quick brown fox jumps over the lazy dog';
const encrypted = await eg.encryptAsync(secret);
const decrypted = await eg.decryptAsync(encrypted);

console.log(decrypted.toString() === secret); // true
View on GitHub
GitHub Stars27
CategoryDevelopment
Updated11mo ago
Forks6

Languages

JavaScript

Security Score

82/100

Audited on Apr 8, 2025

No findings