1- # nilQL
2- [ ![ npm] ( https://badge.fury.io/js/nilql.svg )] ( https://www.npmjs.com/package/@nillion/nilql )
3- [ ![ ci] ( https://github.com/nillionnetwork/nilql-ts/actions/workflows/ci.yaml/badge.svg )] ( https://github.com/nillionnetwork/nilql-ts/actions )
4- [ ![ coveralls] ( https://coveralls.io/repos/github/NillionNetwork/nilql-ts/badge.svg?branch=main )] ( https://coveralls.io/github/NillionNetwork/nilql-ts )
1+ # blindfold-ts
2+
3+ [ ![ npm] ( https://badge.fury.io/js/blindfold.svg )] ( https://www.npmjs.com/package/@nillion/blindfold )
4+ [ ![ ci] ( https://github.com/nillionnetwork/blindfold-ts/actions/workflows/ci.yaml/badge.svg )] ( https://github.com/nillionnetwork/blindfold-ts/actions )
5+ [ ![ coveralls] ( https://coveralls.io/repos/github/NillionNetwork/blindfold-ts/badge.svg?branch=main )] ( https://coveralls.io/github/NillionNetwork/blindfold-ts )
56
67Library for working with encrypted data within nilDB queries and replies.
78
89## Description and Purpose
910
10- This library provides cryptographic operations that are compatible with nilDB nodes and clusters, allowing developers to leverage certain privacy-enhancing technologies (PETs) when storing, operating upon, and retrieving data while working with nilDB. The table below summarizes the functionalities available in nilQL .
11+ This library provides cryptographic operations that are compatible with nilDB nodes and clusters, allowing developers to leverage certain privacy-enhancing technologies (PETs) when storing, operating upon, and retrieving data while working with nilDB. The table below summarizes the functionalities available in blindfold .
1112
1213| Cluster | Operation | Implementation Details | Supported Types |
1314| ----------------| -----------| -------------------------------------------------------------------| ---------------------------------------------------|
@@ -38,7 +39,7 @@ pnpm install
3839The library can be imported in the usual way:
3940
4041``` ts
41- import { nilql } from " @nillion/nilql " ;
42+ import { blindfold } from " @nillion/blindfold " ;
4243```
4344
4445### Example: Generating Keys
@@ -47,35 +48,35 @@ The example below generates a `SecretKey` instance for a single-node cluster:
4748
4849``` ts
4950const cluster = {" nodes" : [{}]};
50- const secretKey = await nilql .SecretKey .generate (cluster , {" store" : true });
51+ const secretKey = await blindfold .SecretKey .generate (cluster , {" store" : true });
5152```
5253
5354The example below generates a ` SecretKey ` instance for a multiple-node (* i.e.* , three-node) cluster with a two-share decryption threshold:
5455
5556``` ts
5657const cluster = {" nodes" : [{}, {}, {}]};
57- const secretKey = await nilql .SecretKey .generate (cluster , {" sum" : true }, 2 );
58+ const secretKey = await blindfold .SecretKey .generate (cluster , {" sum" : true }, 2 );
5859```
5960
6061### Example: Encrypting and Decrypting Data
6162
6263The below example encrypts and decrypts a string:
6364
6465``` ts
65- const secretKey = await nilql .SecretKey .generate ({" nodes" : [{}]}, {" store" : true });
66+ const secretKey = await blindfold .SecretKey .generate ({" nodes" : [{}]}, {" store" : true });
6667const plaintext = " abc" ;
67- const ciphertext = await nilql .encrypt (secretKey , plaintext );
68- const decrypted = await nilql .decrypt (secretKey , ciphertext );
68+ const ciphertext = await blindfold .encrypt (secretKey , plaintext );
69+ const decrypted = await blindfold .decrypt (secretKey , ciphertext );
6970console .log (plaintext , decrypted ); // Should output `abc abc`.
7071```
7172
7273The below example encrypts and decrypts an integer:
7374
7475``` ts
75- const secretKey = await nilql .SecretKey .generate ({" nodes" : [{}, {}, {}]}, {" sum" : true }, 2 );
76+ const secretKey = await blindfold .SecretKey .generate ({" nodes" : [{}, {}, {}]}, {" sum" : true }, 2 );
7677const plaintext = BigInt (123 );
77- const ciphertext = await nilql .encrypt (secretKey , plaintext );
78- const decrypted = await nilql .decrypt (secretKey , ciphertext );
78+ const ciphertext = await blindfold .encrypt (secretKey , plaintext );
79+ const decrypted = await blindfold .decrypt (secretKey , ciphertext );
7980console .log (plaintext , decrypted ); // Should output `123n 123n`.
8081```
8182
0 commit comments