DynamicCipher

A user-implemented dynamic cipher scheme, registered through CipherManager.register.

Types

Link copied to clipboard

Creates and configures instances of Cipher on demand.

Properties

Link copied to clipboard
abstract val isLegacy: Boolean

Whether this cipher is in legacy mode.

Link copied to clipboard
abstract val pageSize: Int

Actual size of a database page in legacy mode. Returning 0 is enough outside of legacy mode, the page size is then determined automatically.

Link copied to clipboard
abstract val reserved: Int

Number of reserved bytes per database page, used to store a HMAC or other data this cipher scheme needs to verify page consistency.

Link copied to clipboard
abstract val salt: Buffer?

Salt for this cipher scheme, or null if Factory.saltSize is 0.

Functions

Link copied to clipboard
abstract override fun close()

Releases the resources this cipher holds.

Link copied to clipboard
abstract fun decryptPage(page: Int, data: Buffer, reserved: Int, hmacCheck: Boolean)

Decrypts a single database page.

Link copied to clipboard
abstract fun encryptPage(page: Int, data: Buffer, reserved: Int)

Encrypts a single database page.

Link copied to clipboard
abstract fun generateKey(userPassword: ByteArray, rekey: Int, cipherSalt: Buffer?)

Derives an encryption key from userPassword.