ToxEncryptSave


Description:

This module is organized into two parts.

  1. A simple API operating on plain text/cipher text data and a password to encrypt or decrypt it.
  2. A more advanced API that splits key derivation and encryption into two separate function calls.

The first part is implemented in terms of the second part and simply calls the separate functions in sequence. Since key derivation is very expensive compared to the actual encryption, clients that do a lot of crypto should prefer the advanced API and reuse pass-key objects.

To use the second part, first derive an encryption key from a password with tox_pass_key_derive, then use the derived key to encrypt the data.

The encrypted data is prepended with a magic number, to aid validity checking (no guarantees are made of course). Any data to be decrypted must start with the magic number.

Clients should consider alerting their users that, unlike plain data, if even one bit becomes corrupted, the data will be entirely unrecoverable. Ditto if they forget their password, there is no way to recover the data.

Part 1

The simple API is presented first. If your code spends too much time using these functions, consider using the advanced functions instead and caching the generated pass-key.

Content:

Classes:

Enums:

Constants:

Functions: