Registry / security / nc97-fhe-sdk

nc97-fhe-sdk

JSON →
library0.2.1jsnpmunverified

TypeScript SDK for Fully Homomorphic Encryption (FHE) encrypt/decrypt flows over gRPC services. Current stable version is 0.2.1. Provides client bindings for FHE operations against a remote gRPC service. Designed for use with Node.js ≥20 and npm ≥7. Includes TypeScript types. Differentiator: provides high-level abstractions over low-level gRPC calls for FHE operations.

npm install nc97-fhe-sdk
INSTALL
IMPORT
SIG · NC97-FHE-SDK
N
nc97-fhe-sdk
securityjavascriptv0.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FheClient
import { FheClient } from 'nc97-fhe-sdk';
const FheClient = require('nc97-fhe-sdk');
Package is ESM-only; require() will fail.
encrypt
import { encrypt } from 'nc97-fhe-sdk';
import { encrypt } from 'nc97-fhe-sdk/encrypt';
encrypt is a named export from the main entry point, not a subpath.
FheConfig
import type { FheConfig } from 'nc97-fhe-sdk';
import { FheConfig } from 'nc97-fhe-sdk';
FheConfig is a TypeScript type, so use `import type` for runtime efficiency.

Shows how to initialize an FheClient, encrypt a plaintext buffer, and decrypt the resulting ciphertext.

import { FheClient, encrypt } from 'nc97-fhe-sdk'; const client = new FheClient({ endpoint: process.env.FHE_ENDPOINT ?? 'localhost:50051' }); const plaintext = Buffer.from('Hello, FHE!'); const ciphertext = await encrypt(client, plaintext); console.log('Encrypted:', ciphertext.toString('hex')); const decrypted = await client.decrypt(ciphertext); console.log('Decrypted:', decrypted.toString());
Debug
Known issues
breakingNode.js <20 is not supported. Engine requirement: node >=20.
fix
Upgrade to Node.js >=20.
affects: <20
deprecatedThe `FheClient` constructor with plain object config is deprecated in favor of using `FheConfig` type.
fix
Use `new FheClient({ ... } as FheConfig)` or pass a typed config.
affects: >=0.2.0
gotchaEncrypt function expects a Buffer, not a string. Passing a string will be coerced silently.
fix
Always pass `Buffer.from('text')` or `Buffer.from(typedArray)`.
affects: >=0.1.0
breakingPackage is ESM-only; CommonJS require() will throw ERR_REQUIRE_ESM.
fix
Use `import` syntax or dynamic import inside a CJS module.
affects: >=0.2.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using require() on an ESM-only package.
fix
Change to `import { FheClient } from 'nc97-fhe-sdk';` or use dynamic import.
TypeError: ciphertext is not a Buffer
Passing a string to encrypt() instead of a Buffer.
fix
Wrap input in Buffer.from().
Error: 12 UNIMPLEMENTED: Method not found
gRPC server does not support the requested FHE operation.
fix
Check the gRPC service definition and ensure the method name matches.
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredgRPC client for communication with FHE service
Agent activity
7 hits · last 30 days
node
6
Resources
nc97-fhe-sdk — npm install nc97-fhe-sdk · libregistry