Enabling Database Encryption with ForestDB
As written in the previous post, Enabling ForestDB for CBL Android, since version 1.2.0, Couchbase Lite supports ForestDB as a storage type. In addition, ForestDB storage supports 256-bit AES encryption. This post explains how to enable database encryption with ForestDB.
About ForestDB, please read the previous post, Enabling ForestDB for CBL Android.
Installing ForestDB module:
ForestDB is a optional. It is not part of default dependencies of couchbase-lite-android. You needs to add forestdb as a dependency in the application level
build.gradle file. As forestdb module supports the encryption feature, it does not require any additional module for the encryption feature.
How to enable the encryption with ForestDB:
By opening the database with the database key, CBL autotamtically opens the database with ForestDB storage with AES 256bit encryption. Please specify the database key (password) with using
- By specifiying database key, attachments are also enctypted by 256-bit AES encryption.
Please refer GrocerySync-Android ForestDB with Encryption branch as a sample Android application.