Use SimpleEncryption for password-based encryption
mainOrbitDB can use the @orbitdb/simple-encryption module for password-based encryption.
WARNING: SimpleEncryption is an unaudited encryption module. Use at your own risk.
- Install the module:
npm i @orbitdb/simple-encryption - Initialize it with a password and pass it to
orbitdb.open()via theencryptionobject.
import { SimpleEncryption } from '@orbitdb/simple-encryption'
const replication = await SimpleEncryption({ password: 'hello' })
const data = await SimpleEncryption({ password: 'world' })
const encryption = { data, replication }
const db = await orbitdb.open(dbNameOrAddress, { encryption })