diff options
author | lloyd <[email protected]> | 2015-02-05 07:44:25 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-02-05 07:44:25 +0000 |
commit | cb0f83ae63c4555cbdd0607e3a5f6e9260c0d19c (patch) | |
tree | 4981027a25fa8074177b97c3a3ca7431f3337deb /src/lib/misc/cryptobox/cryptobox.h | |
parent | 2c14faf0aa1cfe0f8d70af1938dcad5b4d6d3b59 (diff) |
Clean up root dir, remove some unneeded dependencies
Diffstat (limited to 'src/lib/misc/cryptobox/cryptobox.h')
-rw-r--r-- | src/lib/misc/cryptobox/cryptobox.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/lib/misc/cryptobox/cryptobox.h b/src/lib/misc/cryptobox/cryptobox.h new file mode 100644 index 000000000..27dc55a68 --- /dev/null +++ b/src/lib/misc/cryptobox/cryptobox.h @@ -0,0 +1,55 @@ +/* +* Cryptobox Message Routines +* (C) 2009 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +#ifndef BOTAN_CRYPTOBOX_H__ +#define BOTAN_CRYPTOBOX_H__ + +#include <string> +#include <botan/rng.h> +#include <botan/symkey.h> + +namespace Botan { + +/** +* This namespace holds various high-level crypto functions +*/ +namespace CryptoBox { + +/** +* Encrypt a message using a passphrase +* @param input the input data +* @param input_len the length of input in bytes +* @param passphrase the passphrase used to encrypt the message +* @param rng a ref to a random number generator, such as AutoSeeded_RNG +*/ +BOTAN_DLL std::string encrypt(const byte input[], size_t input_len, + const std::string& passphrase, + RandomNumberGenerator& rng); + + +/** +* Decrypt a message encrypted with CryptoBox::encrypt +* @param input the input data +* @param input_len the length of input in bytes +* @param passphrase the passphrase used to encrypt the message +*/ +BOTAN_DLL std::string decrypt(const byte input[], size_t input_len, + const std::string& passphrase); + +/** +* Decrypt a message encrypted with CryptoBox::encrypt +* @param input the input data +* @param passphrase the passphrase used to encrypt the message +*/ +BOTAN_DLL std::string decrypt(const std::string& input, + const std::string& passphrase); + +} + +} + +#endif |