Encryptor

class Encryptor(val encryptFn: (String) -> String, val decryptFn: (String) -> String, val maxColLengthFn: (Int) -> Int)

Base cipher class responsible for the encryption and decryption of data.

Samples

org.jetbrains.exposed.crypt.Algorithms.AES_256_PBE_GCM

Constructors

Link copied to clipboard
constructor(encryptFn: (String) -> String, decryptFn: (String) -> String, maxColLengthFn: (Int) -> Int)

Properties

Link copied to clipboard

Decrypt ciphertext to a plaintext string.

Link copied to clipboard

Encrypt a plaintext string to ciphertext.

Link copied to clipboard

Convert the expected input length into the maximum encoded length to be stored.

Functions

Link copied to clipboard
fun decrypt(str: String): String

Returns a decrypted value using decryptFn.

Link copied to clipboard
fun encrypt(str: String): String

Returns an encrypted value using encryptFn.

Link copied to clipboard
fun maxColLength(inputByteSize: Int): Int

Returns the maximum column length needed to store an encrypted value, using the specified inputByteSize, and determined by maxColLengthFn.