XChaChaPoly1305AuthenticationData

internal data class XChaChaPoly1305AuthenticationData(val passphrase: String, val salt: <Error class: unknown class>, val additionalData: <Error class: unknown class> = ubyteArrayOf(), val hashOpsLimit: <Error class: unknown class> = HASH_OPS_LIMIT, val hashMemLimit: Int = HASH_MEM_LIMIT)

Parameters

passphrase

the password created by the user when encrypting

salt

the random bytes to spice things up, can be created with XChaChaPoly1305AuthenticationData.newSalt.

additionalData

extra data that can be used and can be validated together with the encrypted data.

It is optional and an empty array can be used, if no extra plaintext data needs to be validated.

For the purposes of backup, we can use a hash of the non-encrypted bytes of the file as additional data. This way, if these bytes were tempered with, the decryption will also fail. The idea is to do not trust any fruit from the poisoned tree.

Constructors

Link copied to clipboard
constructor(passphrase: String, salt: <Error class: unknown class>, additionalData: <Error class: unknown class> = ubyteArrayOf(), hashOpsLimit: <Error class: unknown class> = HASH_OPS_LIMIT, hashMemLimit: Int = HASH_MEM_LIMIT)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val additionalData: <Error class: unknown class>
Link copied to clipboard
val hashMemLimit: Int
Link copied to clipboard
val hashOpsLimit: <Error class: unknown class>
Link copied to clipboard
val passphrase: String
Link copied to clipboard
val salt: <Error class: unknown class>