openSqlCipher function

Future<SqlCipherDatabase> openSqlCipher(
  1. String path,
  2. String passphrase, {
  3. int iterations = SqlCipher.iterations,
  4. int pageSize = 4096,
})

Reads a SQLCipher 4 database file.

The bytes are decrypted once. Later SQL uses the plaintext image. This does not take a SQLite lock and does not read a -wal file.

Implementation

Future<SqlCipherDatabase> openSqlCipher(String path, String passphrase,
    {int iterations = SqlCipher.iterations, int pageSize = 4096}) async {
  final bytes = await File(path).readAsBytes();
  return SqlCipherDatabase.open(Uint8List.fromList(bytes), passphrase,
      iterations: iterations, pageSize: pageSize);
}