Encryption - DataDog/dd-sdk-android GitHub Wiki

interface Encryption

Interface that allows storing data in encrypted format. Encryption/decryption round should return exactly the same data as it given for the encryption originally (even if decryption happens in another process/app launch).

Functions

decrypt

abstract fun decrypt(data: ByteArray): ByteArray

Decrypts given ByteArray with user-chosen encryption.

Parameters
data Bytes to decrypt. Beware that data to decrypt could be encrypted in a previous app launch, so implementation should be aware of the case when decryption could fail (for example, key used for encryption is different from key used for decryption, if they are unique for every app launch).

encrypt

abstract fun encrypt(data: ByteArray): ByteArray

Encrypts given ByteArray with user-chosen encryption.

Parameters
data Bytes to encrypt.