Classes | Typedefs | Functions | Variables

crypto Namespace Reference

Classes

class  RSAPublicKey
 public key suitable for encrypting More...
class  RSAKey
 private/public key pair. More...
class  DESKey
 fast symmetric encryption More...

Typedefs

typedef std::vector< byte_tbyte_vec_t

Functions

static void initializeDecoding (void) throw ()
static void encodeInt32 (std::string &out, int32_t l)
static int32_t decodeInt32 (const char *p)
static long symmetricEncrypt (const byte_t *input, long bytes, DES_key_schedule *ks, int flag, byte_vec_t &output)
void decodeBase64 (const char *encoded, byte_vec_t &data)

Variables

static const int s_keyNumber = 1536
static const long s_keyExponent = 65537
static const int s_padding = RSA_PKCS1_OAEP_PADDING
static const int32_t s_maxEncodeLength = 0x007FFFFFF
static const int s_bytesPerDESBlock = 8
static char s_base64encode [65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
static int s_base64decode [128]



typedef std::vector< byte_tvec_byte_t
std::string getSHA1 (const char *data)
 quick one-way encryption (SHA1 algorithm, see http://en.wikipedia.org/wiki/SHA-1)
std::string encodeBase64 (const byte_t *data,long bytes,bool encodeLength=true)
 given binary data, encode into base64 ascii string
void decodeBase64 (const char *base64, vec_byte_t &data)
 given base64 ascii string, decode into byte array

Typedef Documentation

typedef std::vector<byte_t> crypto::byte_vec_t

Definition at line 48 of file crypto.cpp.


Function Documentation

static void crypto::initializeDecoding ( void   )  throw () [static]

Definition at line 71 of file crypto.cpp.

static void crypto::encodeInt32 ( std::string &  out,
int32_t  l 
) [static]

Definition at line 94 of file crypto.cpp.

static int32_t crypto::decodeInt32 ( const char *  p  )  [static]

Definition at line 118 of file crypto.cpp.

static long crypto::symmetricEncrypt ( const byte_t input,
long  bytes,
DES_key_schedule *  ks,
int  flag,
byte_vec_t &  output 
) [static]

Definition at line 158 of file crypto.cpp.

void crypto::decodeBase64 ( const char *  encoded,
byte_vec_t &  data 
)

Definition at line 862 of file crypto.cpp.


Variable Documentation

const int crypto::s_keyNumber = 1536 [static]

Definition at line 40 of file crypto.cpp.

const long crypto::s_keyExponent = 65537 [static]

Definition at line 41 of file crypto.cpp.

const int crypto::s_padding = RSA_PKCS1_OAEP_PADDING [static]

Definition at line 42 of file crypto.cpp.

const int32_t crypto::s_maxEncodeLength = 0x007FFFFFF [static]

Definition at line 44 of file crypto.cpp.

const int crypto::s_bytesPerDESBlock = 8 [static]

Definition at line 46 of file crypto.cpp.

char crypto::s_base64encode[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" [static]

Definition at line 57 of file crypto.cpp.

int crypto::s_base64decode[128] [static]

Definition at line 60 of file crypto.cpp.