Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

cryptobox.h
Go to the documentation of this file.
1 /*
2 * Cryptobox Message Routines
3 * (C) 2009 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_CRYPTOBOX_H__
9 #define BOTAN_CRYPTOBOX_H__
10
11 #include <string>
12 #include <botan/rng.h>
13 #include <botan/symkey.h>
14
15 namespace Botan {
16
17 /**
18 * This namespace holds various high-level crypto functions
19 */
20 namespace CryptoBox {
21
22 /**
23 * Encrypt a message using a passphrase
24 * @param input the input data
25 * @param input_len the length of input in bytes
26 * @param passphrase the passphrase used to encrypt the message
27 * @param rng a ref to a random number generator, such as AutoSeeded_RNG
28 */
29 BOTAN_DLL std::string encrypt(const uint8_t input[], size_t input_len,
30 const std::string& passphrase,
31 RandomNumberGenerator& rng);
32
33
34 /**
35 * Decrypt a message encrypted with CryptoBox::encrypt
36 * @param input the input data
37 * @param input_len the length of input in bytes
38 * @param passphrase the passphrase used to encrypt the message
39 */
40 BOTAN_DLL std::string decrypt(const uint8_t input[], size_t input_len,
41 const std::string& passphrase);
42
43 /**
44 * Decrypt a message encrypted with CryptoBox::encrypt
45 * @param input the input data
46 * @param passphrase the passphrase used to encrypt the message
47 */
48 BOTAN_DLL std::string decrypt(const std::string& input,
49 const std::string& passphrase);
50
51 }
52
53 }
54
55 #endif
Botan::CryptoBox::encrypt
std::string encrypt(const uint8_t input[], size_t input_len, const std::string &passphrase, RandomNumberGenerator &rng)
Definition: cryptobox.cpp:42
Botan::CryptoBox::decrypt
std::string decrypt(const uint8_t input[], size_t input_len, const std::string &passphrase)
Definition: cryptobox.cpp:102
Botan
Definition: alg_id.cpp:13