Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
hdi::core::crypt::aes Namespace Reference

Organizes all AES functionality into one namespace for convenience. More...

Classes

class  InitVector
 Wraps around an AES initialization vector's raw data for some added conveniences. More...
 
class  Key
 Wraps around an AES key's raw data for some added conveniences. More...
 

Typedefs

typedef std::vector< byteByteVector
 
typedef std::unique_ptr< KeyKeyUP
 
typedef std::shared_ptr< KeyKeySP
 
typedef std::weak_ptr< KeyKeyWP
 
typedef std::unique_ptr< InitVectorInitVectorUP
 
typedef std::shared_ptr< InitVectorInitVectorSP
 
typedef std::weak_ptr< InitVectorInitVectorWP
 

Functions

bool encrypt (const Key &key_, const InitVector &iv_, const std::string &data_, std::string &b64Cipher__)
 Encrypts a string (or raw bytes stuffed into a string) with an AES key.
 
bool decrypt (const Key &key_, const InitVector &iv_, const std::string &b64Cipher_, std::string &data__)
 Decrypts a base-64 encoded string of cipher text (previously encrypted with the encrypt() function or equivalent)
 
plat::AESKey * __accessImpl (const Key &)
 
plat::AESInitializationVector * __accessImpl (const InitVector &)
 

Detailed Description

Organizes all AES functionality into one namespace for convenience.

Function Documentation

◆ decrypt()

bool hdi::core::crypt::aes::decrypt ( const Key key_,
const InitVector iv_,
const std::string &  b64Cipher_,
std::string &  data__ 
)

Decrypts a base-64 encoded string of cipher text (previously encrypted with the encrypt() function or equivalent)

Author
GW
Date
10/2013
Parameters
key_AES key to use for decryption
iv_Initialization vector to use for this decryption call
b64Cipher_Base-64 encoded cipher text to attempt to decrypt
data__Return-by-reference for the decrypted plain text (or raw bytes stuffed into a string)
Returns
true if the data could be decrypted, false otherwise

◆ encrypt()

bool hdi::core::crypt::aes::encrypt ( const Key key_,
const InitVector iv_,
const std::string &  data_,
std::string &  b64Cipher__ 
)

Encrypts a string (or raw bytes stuffed into a string) with an AES key.

Author
GW
Date
10/2013
Parameters
key_AES key to use for encryption
iv_Initialization vector to use for this encryption call
data_Plain data to be encrypted (in the form of a string or binary data inside of a string object)
b64Cipher__Return-by-reference for the base-64 encoded cipher text
Returns
true if the data could be encrypted, false otherwise
Note
To decrypt the cipher, use the decrypt() function (or equivalent - this lib is built on OpenSSL and the AES standard, so any base-64 decoder and function that understands AES decryption can decrypt the cipher with the correct key and initialization vector).