EncryptedStream

Provides functions to encrypt and decrypt streams of data. Streams of data: big amounts of data, that can be split into smaller chunks / messages. For example, a huge file can be read in chunks, encrypted in chunks and then decrypted in chunks. This is done using Source and Sink.

Inheritors

Types

Link copied to clipboard

Implementation of EncryptedStream that relies on Libsodium's SecretStream. It will encrypt the whole Source into an output Sink in smaller messages of INDIVIDUAL_PLAINTEXT_MESSAGE_SIZE.

Functions

Link copied to clipboard
abstract suspend fun decrypt(source: <Error class: unknown class>, outputSink: <Error class: unknown class>, authenticationData: AuthenticationData): DecryptionResult

Decrypts the source data using the provided authenticationData. The result is fed into the outputSink.

Link copied to clipboard
abstract suspend fun encrypt(source: <Error class: unknown class>, outputSink: <Error class: unknown class>, authenticationData: AuthenticationData)

Encrypts the source data using the provided authenticationData. The result is fed into the outputSink.