summaryrefslogtreecommitdiffstats
path: root/comm/third_party/botan/doc/api_ref/cryptobox.rst
blob: dbade88af588a70832acbe69e5b7219e43ff56d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Cryptobox
========================================

Encryption using a passphrase
----------------------------------------

.. versionadded:: 1.8.6

This is a set of simple routines that encrypt some data using a
passphrase. There are defined in the header `cryptobox.h`, inside
namespace `Botan::CryptoBox`.

It generates cipher and MAC keys using 8192 iterations of PBKDF2 with
HMAC(SHA-512), then encrypts using Serpent in CTR mode and authenticates using a
HMAC(SHA-512) mac of the ciphertext, truncated to 160 bits.

 .. cpp:function:: std::string encrypt(const uint8_t input[], size_t input_len, \
                                       const std::string& passphrase, \
                                       RandomNumberGenerator& rng)

    Encrypt the contents using *passphrase*.

 .. cpp:function:: std::string decrypt(const uint8_t input[], size_t input_len, \
                                       const std::string& passphrase)

    Decrypts something encrypted with encrypt.

 .. cpp:function:: std::string decrypt(const std::string& input, \
                                       const std::string& passphrase)

    Decrypts something encrypted with encrypt.