Classes | |
| class | CryptoException |
Functions | |
| vector< unsigned char > * | encryptAES256CBC (const unsigned char *bytes, int bytesCount, const string &key, const string &iv) |
| vector< unsigned char > * | encryptAES256CBC (const string &plainText, const string &key, const string &iv) |
| string | decryptAES256CBC (const vector< unsigned char > &encryptedChars, string key, string iv) |
| void | generateAES256KeyAndIVFromPassword (const string &password, string &key, string &iv) |
| vector< unsigned char > * | encryptAES256CBCWithPassword (const string &plainText, const string &password) |
| string | decryptAES256CBCWithPassword (const vector< unsigned char > &encryptedChars, const string &password) |
| static bool | isBase64Char (const unsigned char c) |
| string | encodeBase64 (const unsigned char *buf, unsigned int bufLen) |
| vector< unsigned char > * | decodeBase64 (const string &encodedString) |
| string | hashFileMd5 (const fs::path &filePath) |
| string | hashMd5 (const string &input) |
| string | hashSha512 (const string &input) |
| string | hashUniqueSimpleShift (const string &input) |
| "Perfect" hash function by shifting each character by 1000. More... | |
Variables | |
| constexpr int | AES_256_KEY_BYTES_LEN = 256 / 8 |
| constexpr int | AES_256_IV_BYTES_LEN = 128 / 8 |
| static const std::string | base64Chars |
| vector< unsigned char > * conscience_utils::crypto::decodeBase64 | ( | const string & | encodedString | ) |
| string conscience_utils::crypto::decryptAES256CBC | ( | const vector< unsigned char > & | encryptedChars, |
| string | key, | ||
| string | iv | ||
| ) |
| string conscience_utils::crypto::decryptAES256CBCWithPassword | ( | const vector< unsigned char > & | encryptedChars, |
| const string & | password | ||
| ) |
| string conscience_utils::crypto::encodeBase64 | ( | const unsigned char * | buffer, |
| unsigned int | bufferLen | ||
| ) |
| buffer | not deleted in this method |
| vector< unsigned char > * conscience_utils::crypto::encryptAES256CBC | ( | const string & | plainText, |
| const string & | key, | ||
| const string & | iv | ||
| ) |
| vector< unsigned char > * conscience_utils::crypto::encryptAES256CBC | ( | const unsigned char * | bytes, |
| int | bytesCount, | ||
| const string & | key, | ||
| const string & | iv | ||
| ) |
| bytes | not deleted inside this method |
| vector< unsigned char > * conscience_utils::crypto::encryptAES256CBCWithPassword | ( | const string & | plainText, |
| const string & | password | ||
| ) |
Given password will be hashed using SHA512 to generate AES key on side and IV on another. Note : IV will be picked from generated sha512 at random indexes based on password length
| void conscience_utils::crypto::generateAES256KeyAndIVFromPassword | ( | const string & | password, |
| string & | key, | ||
| string & | iv | ||
| ) |
| string conscience_utils::crypto::hashFileMd5 | ( | const fs::path & | filePath | ) |
| string conscience_utils::crypto::hashMd5 | ( | const string & | input | ) |
| string conscience_utils::crypto::hashSha512 | ( | const string & | input | ) |
| string conscience_utils::crypto::hashUniqueSimpleShift | ( | const string & | input | ) |
"Perfect" hash function by shifting each character by 1000.
This method takes each character of the input, adds 1000 to its ASCII code, and returns the result as a single string. It's called "perfect" because, by design, it produces a unique transformation for any input without collisions.
However, this type of hashing is of limited interest: the output remains roughly as long as the input string, and this approach primarily serves to obfuscate or blur the original data rather than providing the kind of compact digest typically expected from a hash function.
|
inlinestatic |
|
constexpr |
|
constexpr |
|
static |