![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
merkle-hellman
Advanced tools
Decoder, Encoder and Cracker for Merkle–Hellman knapsack cryptosystem
The Merkle–Hellman knapsack cryptosystem was one of the earliest public key cryptosystems invented by Ralph Merkle and Martin Hellman in 1978. The ideas behind it are simpler than those involving RSA, and it has been broken. Source: © WikiPedia
Via npm:
npm i merkle-hellman
via yarn:
yarn add merkle-hellman
Do not use this system in projects where a cryptographic encryption algorithm is required. The crypto-system is easy to be cracked
Use Encoder
class and encode
method for encoding source message
Use Decoder
class and decode
method for decoding encoded message
Use Cracker
class and crack
method for getting secret key from public key
Encoding/Decoding messages:
import {
Decoder,
Encoder,
} from 'merkle-hellman';
const decoder = new Decoder();
const encoder = new Encoder(decoder.publicKey);
const message = 'Lorem ipsum dolor sit amet.';
const encodedMessage = encoder.encode(message);
const decodedMessage = decoder.decode(encodedMessage);
console.log(`Source message: ${message}`);
console.log(`Encoded message: ${encodedMessage}`);
console.log(`Decoded message: ${decodedMessage}`);
Cracking public key:
import {
Decoder,
Cracker,
Encoder,
} from 'merkle-hellman';
const q = 881;
const r = 588;
const secretKey = [2, 7, 11, 21, 42, 89, 180, 354];
const publicKey = [295, 592, 301, 14, 28, 353, 120, 236];
const originalDecoder = Decoder.from({ secretKey, q, r });
const encoder = new Encoder(originalDecoder.publicKey);
const cracker = new Cracker();
const secretInfo = cracker.crack(originalDecoder.publicKey);
const crackBaseDecoder = Decoder.from(secretInfo);
const message = 'Lorem ipsum dolor sit amet.';
const encodedMessage = encoder.encode(message);
const decodedMessage = crackBaseDecoder.decode(encodedMessage);
console.log(`Source message: ${message}`);
console.log(`Encoded message: ${encodedMessage}`);
console.log(`Decoded message: ${decodedMessage}`);
console.log();
console.log(`Public key: ${publicKey}`);
console.log(`Secret key: ${secretKey}`);
console.log(`Cracked secret key: ${secretInfo.secretKey}`);
FAQs
Decoder, Encoder and Cracker for Merkle–Hellman knapsack cryptosystem
We found that merkle-hellman demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.