|
static std::string | encryptAES (const std::string &data, const RipeByte *key, std::size_t keySize, std::vector< RipeByte > &iv) |
| Encrypts data of length with symmetric key of size = keySize with specified initialization vector.
|
|
static std::string | decryptAES (const std::string &data, const RipeByte *key, std::size_t keySize, std::vector< RipeByte > &iv) |
| Decrypts data of specified length with specified key and initialization vector.
|
|
static std::string | generateNewKey (int length) |
| Generate random AES key. More...
|
|
static std::string | encryptAES (std::string &data, const std::string &hexKey, const std::string &clientId, const std::string &outputFile, const std::string &iv="") |
| encryptAES Encrypts data with provided symmetric key More...
|
|
static std::string | encryptAES (const std::string &buffer, const std::string &hexKey, std::vector< RipeByte > &iv) |
| Helper function that takes hex key. More...
|
|
static std::string | decryptAES (std::string &data, const std::string &hexKey, std::string &iv, bool isBase64=false, bool isHex=false) |
| decryptAES Decrypts data using specified symmetric key. More...
|
|
static std::size_t | expectedAESCipherLength (std::size_t plainDataSize) |
| Exceptect size of AES cipher when plainDataSize size data is encrypted.
|
|
static bool | normalizeHex (std::string &iv) |
| normalizeIV If IV with no space is provided e.g, More...
|
|
static std::string | encryptRSA (const std::string &data, const std::string &publicKeyPEM) |
| Encrypts data of length = dataLength using RSA key and puts it in destination. More...
|
|
static std::string | decryptRSA (const std::string &data, const std::string &privateKeyPEM, const std::string &secret="") |
| Decrypts encryptedData of length dataLength with RSA key and puts result in destination. More...
|
|
static bool | verifyRSA (const std::string &data, const std::string &signatureHex, const std::string &publicKeyPEM) |
| Verifies the data is signed by associated private key. More...
|
|
static std::string | signRSA (const std::string &data, const std::string &privateKeyPEM, const std::string &secret="") |
| Signs the data with private key. More...
|
|
static KeyPair | generateRSAKeyPair (unsigned int length=DEFAULT_RSA_LENGTH, const std::string &secret="") |
| Generate key pair and returns KeyPair. More...
|
|
static unsigned int | maxRSABlockSize (std::size_t keySize) |
| Maximum size of RSA block with specified key size. More...
|
|
static unsigned int | minRSAKeySize (std::size_t dataSize) |
| Minimum size of RSA key to encrypt data of dataSize size.
|
|
static std::string | encryptRSA (std::string &data, const std::string &key, const std::string &outputFile, bool isRaw=false) |
| encryptRSA Encrypts using RSA key More...
|
|
static std::string | decryptRSA (std::string &data, const std::string &key, bool isBase64, bool isHex=false, const std::string &secret="") |
| decryptRSA Decrypts using RSA key More...
|
|
static bool | writeRSAKeyPair (const std::string &publicFile, const std::string &privateFile, int length=DEFAULT_RSA_LENGTH, const std::string &secret="") |
| writeRSAKeyPair Writes RSA key pair to public and private file paths. More...
|
|
static std::string | generateRSAKeyPairBase64 (int length=DEFAULT_RSA_LENGTH, const std::string &secret="") |
| generateRSAKeyPair Generates RSA key pair and returns colon seperated base64 where first part is private key and second part is public key.
|
|
static std::string | base64Decode (const std::string &base64Encoded) |
| Decodes encoded base64.
|
|
static std::string | base64Encode (const std::string &binaryData) |
| Encodes input of length to base64 encoding.
|
|
static std::size_t | expectedBase64Length (std::size_t n) |
| expectedBase64Length Returns expected base64 length More...
|
|
static bool | isBase64 (const std::string &data) |
| Finds whether data is base64 encoded. This is done by finding non-base64 character. So it is not necessary a valid base64 encoding.
|
|
static bool | compressFile (const std::string &gzFilename, const std::string &inputFile) |
| Compress input file (path) and create new file. More...
|
|
static std::string | compressString (const std::string &str) |
| Compresses string using zlib (inflate) More...
|
|
static std::string | decompressString (const std::string &str) |
| Decompresses string using zlib (deflate) More...
|
|
static std::string | sha256Hash (const std::string &) |
| Generate SHA-256 hash of given string.
|
|
static std::string | sha512Hash (const std::string &) |
| Generate SHA-512 hash of given string.
|
|
static std::string | prepareData (const std::string &data, const std::string &hexKey, const char *clientId="", const std::string &ivec="") |
| prepareData Helper method to encrypt data with symmetric key and convert it in to tranferable data. More...
|
|
static std::size_t | expectedDataSize (std::size_t plainDataSize, std::size_t clientIdSize=16) |
| Calculates expected data size. Assumed IV size = 32. More...
|
|
static std::string | stringToHex (const std::string &raw) |
| Helper function to convert string to hexdecimal e.g, khn = 6b686e.
|
|
static std::string | hexToString (const std::string &hex) |
| Helper function to convert hexadecimal input to raw data.
|
|
static std::string | vecToString (const std::vector< RipeByte > &iv) |
| Converts vector of RipeByte to raw string.
|
|
static std::vector< RipeByte > | RipeByteToVec (const RipeByte *iv) |
| ivToVector Converts plain (unsigned char*) IV to std::vector<RipeByte>
|
|
static std::string | version () |
| version Version of Ripe library
|
|
The Ripe class is core of Ripe library and contains all the required cryptography API supported by Ripe.