Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

fpe_fe1.h
Go to the documentation of this file.
1 /*
2 * Format Preserving Encryption (FE1 scheme)
3 * (C) 2009 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_FPE_FE1_H__
9 #define BOTAN_FPE_FE1_H__
10
11 #include <botan/bigint.h>
12 #include <botan/symkey.h>
13
14 namespace Botan {
15
16 namespace FPE {
17
18 /**
19 * Format Preserving Encryption using the scheme FE1 from the paper
20 * "Format-Preserving Encryption" by Bellare, Rogaway, et al
21 * (http://eprint.iacr.org/2009/251)
22 *
23 * Encrypt X from and onto the group Z_n using key and tweak
24 * @param n the modulus
25 * @param X the plaintext as a BigInt
26 * @param key a random key
27 * @param tweak will modify the ciphertext (think of as an IV)
28 */
29 BigInt BOTAN_DLL fe1_encrypt(const BigInt& n, const BigInt& X,
30 const SymmetricKey& key,
31 const std::vector<uint8_t>& tweak);
32
33 /**
34 * Decrypt X from and onto the group Z_n using key and tweak
35 * @param n the modulus
36 * @param X the ciphertext as a BigInt
37 * @param key is the key used for encryption
38 * @param tweak the same tweak used for encryption
39 */
40 BigInt BOTAN_DLL fe1_decrypt(const BigInt& n, const BigInt& X,
41 const SymmetricKey& key,
42 const std::vector<uint8_t>& tweak);
43
44 }
45
46 }
47
48 #endif
Botan::FPE::fe1_decrypt
BigInt fe1_decrypt(const BigInt &n, const BigInt &X0, const SymmetricKey &key, const std::vector< uint8_t > &tweak)
Definition: fpe_fe1.cpp:160
Botan
Definition: alg_id.cpp:13
Botan::SymmetricKey
OctetString SymmetricKey
Definition: symkey.h:136
Botan::FPE::fe1_encrypt
BigInt fe1_encrypt(const BigInt &n, const BigInt &X0, const SymmetricKey &key, const std::vector< uint8_t > &tweak)
Definition: fpe_fe1.cpp:132