Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
node-hcrypt
Advanced tools
Readme
This package provides an API for node.js application to use homomorphic encryption to perform some computations.
Only integers are currently supported.
Operations supported: algebraic addition and multiplication.
You must have GMP (5.0.0+ or MPIR 2.6.0+) and MPFR (3.0.0+) libraries installed in the system. Also, build tools are required for the native addon.
For Debian-based: sudo apt-get install libgmp-dev libmpfr-dev libmpfr4 gcc g++ automake autoconf
For RHEL-based: sudo yum install gmp mpfr gcc gcc-c++ automake autoconf
, but note that gmp and mpfr versions in the repo are outdated so you should just compile them from sources.
On Windows you can use cygwin, just don't forget to set GMP and MPFR to devel while installing.
This package should work with latest stable npm and node, but may also work with any below. If you run into any problems while installing be sure to udpate npm first.
MPFR: http://www.mpfr.org/mpfr-current/#download GMP: https://gmplib.org/#DOWNLOAD
npm install node-hcrypt
The installation may take a while.
The module exports two main object types: Crypto and Operator. Crypto provides with encrypting / decrypting functionality while Operator deals with the operations on encrypted data. Module also exports helpers for converting any arbitrary numbers and performing operations with them, but they will be integrated into the mentioned above object types soon.
var hcrypt = require('node-hcrypt');
var crypto = new hcrypt.Crypto();
Method | Description |
---|---|
encrypt(int bit):string | Encrypts 1 or 0. Returns encrypted value as a base64 string. |
decrypt(string encrypted):int | Decrypts. Returns 1 or 0. |
export():object | Returns public key for use with Operator. |
var hcrypt = require('node-hcrypt');
var crypto = new hcrypt.Crypto();
var operator = new hcrypt.Operator(crypto.export());
Method | Description |
---|---|
add(string encryptedA, string encryptedB):string encryptedC | Performs logical addition. |
mul(string encryptedA, string encryptedB):string encryptedC | Performs logical multiplication. |
halfAdd(string encryptedA, string encryptedB):[string encryptedC, string carryD] | Performs half-addition with carry in return. |
fullAdd(string carryI, string encryptedA, string encryptedB):[string encryptedC, string carryD] | Performs full addition with a carry in return. |
recrypt(string encryptedI):string encryptedO | Performs cryptographic refresh. Should be done after 2-3 operations under the same encrypted value. |
WIP
MIT
FAQs
Fully homomorphic encryption implementation for node.js
The npm package node-hcrypt receives a total of 2 weekly downloads. As such, node-hcrypt popularity was classified as not popular.
We found that node-hcrypt 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.