Namespaces | Typedefs | Functions | Variables

crypto.cpp File Reference

#include "crypto.h"
#include <openssl/des.h>
#include <openssl/rsa.h>
#include <openssl/sha.h>
#include "common/wave_ex.h"
#include "perf/perf.h"
Include dependency graph for crypto.cpp:

Go to the source code of this file.

Namespaces

namespace  crypto

Typedefs

typedef std::vector< byte_tcrypto::byte_vec_t

Functions

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

std::string crypto::getSHA1 (const char *data)
 quick one-way encryption (SHA1 algorithm, see http://en.wikipedia.org/wiki/SHA-1)
std::string crypto::encodeBase64 (const byte_t *data,long bytes,bool encodeLength=true)
 given binary data, encode into base64 ascii string

Variables

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