File: cryptobox.rst

package info (click to toggle)
botan 2.17.3%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 34,200 kB
  • sloc: cpp: 141,566; python: 8,843; xml: 181; makefile: 125; sh: 72; lisp: 34
file content (32 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (16)
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.