Encrypt and Decrypt Data
Use nilQL to encrypt and decrypt data.
- To apply encryption to your data, they are to be secret shared across your selected nodes.
- This is to be done with nilQL, a library for working with encrypted data within nilDB queries and replies, available in Python and TypeScript.
- You can find an example on using nilQL to encrypt/decrypt data below.
Installation
Install nilQL using your preferred package manager:
- Python
- JavaScript
Standalone Library Usage
- Python
- JavaScript
nildb/secretvault_python/encryption.py
loading...
nildb/secretvault_nextjs/app/lib/encryption.ts
loading...
Usage with SecretVault and SecretDataAnalytics
To encrypt data for use within SecretVault and SecretDataAnalytics, you can create a cluster key by passing in
- your cluster config of node urls and node DIDs
- your selected operation (store, match, sum)
const cluster = {
nodes: [
{
url: 'https://nildb-zy8u.nillion.network',
did: 'did:nil:testnet:nillion1fnhettvcrsfu8zkd5zms4d820l0ct226c3zy8u',
},
{
url: 'https://nildb-rl5g.nillion.network',
did: 'did:nil:testnet:nillion14x47xx85de0rg9dqunsdxg8jh82nvkax3jrl5g',
},
{
url: 'https://nildb-lpjp.nillion.network',
did: 'did:nil:testnet:nillion167pglv9k7m4gj05rwj520a46tulkff332vlpjp',
}
]
}
const operation = {
store: true
}
nilQl/wrapper.js
loading...