Socket
Book a DemoInstallSign in
Socket

@orbitdb/simple-encryption

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orbitdb/simple-encryption

A simple password encryption module that encrypts data using AES-GCM PBKDF2.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
4
Created
Source

OrbitDB Simple Encryption

Matrix npm (scoped) node-current (scoped)

A simple password encryption module that encrypts data using AES-GCM PBKDF2.

NOTE This encryption module is not audited in any way for security and is intended for demonstration purposes only.

Install

This project uses npm and nodejs.

npm i @orbitdb/simple-encryption

Usage

To implement encryption within your database, create an encryption object and pass it to OrbitDB's open function:

import { createOrbitDB } from '@orbitdb/core'
import { SimpleEncryption } from '@orbitdb/simple-encryption'


// Instantiate encryption for either data, replication or both.
const replication = await SimpleEncryption({ password: 'hello' })
const data = await SimpleEncryption({ password: 'world' })

const encryption = { data, replication }

// Set up OrbitDB. See https://github.com/orbitdb/orbitdb/blob/main/docs/GETTING_STARTED.md for more information if you are unfamiliar with OrbitDB.
const db = await orbitdb.open('db-encrypted', { encryption })

When replicating a database, initiate the same encryption configuration and pass it to open:

import { createOrbitDB } from '@orbitdb/core'
import { SimpleEncryption } from '@orbitdb/simple-encryption' 


// Instantiate encryption for either data, replication or both.
const replication = await SimpleEncryption({ password: 'hello' })
const data = await SimpleEncryption({ password: 'world' })

const encryption = { data, replication }

const dbAddress = '0x0' // the address of the remote database. 

// Set up OrbitDB. See https://github.com/orbitdb/orbitdb/blob/main/docs/GETTING_STARTED.md for more information if you are unfamiliar with OrbitDB.
const db = await orbitdb.open(dbAddress, { encryption })

Contributing

Take a look at our organization-wide Contributing Guide. You'll find most of your questions answered there. Some questions may be answered in the FAQ, as well.

If you want to code but don't know where to start, check out the issues labelled "help wanted".

License

MIT OrbitDB Community

Keywords

orbitdb

FAQs

Package last updated on 26 May 2025

Did you know?

Socket

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.

Install

Related posts