Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

paillier-bigint

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paillier-bigint - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "paillier-bigint",
"version": "1.0.4",
"version": "1.0.5",
"description": "An implementation of the Paillier cryptosystem using native JS (stage 3) implementation of BigInt",

@@ -5,0 +5,0 @@ "keywords": [

@@ -54,4 +54,4 @@ # bigint-paillier

4. Select generator `g` where in Z* of `n^2`. `g` can be computed as follows (there are other ways):
* Generate randoms `λ` and `β` in Z* of n (i.e. `0<λ<n` and `0<β<n`).
* Compute `g=( λ·n + 1 ) β^n mod n^2`
* Generate randoms `α` and `β` in Z* of n (i.e. `0<α<n` and `0<β<n`).
* Compute `g=( α·n + 1 ) β^n mod n^2`
5. Compute `μ=( L( g^λ mod n^2 ) )^(-1) mod n` where `L(x)=(x-1)/n`.

@@ -64,10 +64,12 @@

## Encryption
Let `m` in Z* of `n` be the clear-text message, 1. Select random `r` in Z* of `n^2`.
Let `m` in Z* of `n` be the clear-text message,
Compute ciphertext as: **`c=g^m · r^n mod n^2`**
1. Select random `r` in Z* of `n^2`.
2. Compute ciphertext as: **`c=g^m · r^n mod n^2`**
## Decryption
Let `c` be the ciphertext to decrypt, where `c` in Z* of `n^2`.
Compute the plaintext message as: **`m=L( c^λ mod n^2 ) · μ mod n`**
1. Compute the plaintext message as: **`m=L( c^λ mod n^2 ) · μ mod n`**

@@ -74,0 +76,0 @@ ## Installation

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc