libDwmAuth-0.3.6
DwmAuthSymCrypto.hh File Reference

Symmetric crypto utility definitions. More...

#include <string>
Include dependency graph for DwmAuthSymCrypto.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string Dwm::Auth::SymCrypto::Encrypt (const std::string &keystr, const std::string &ivstr, const std::string &plaintext)
 Encrypts the given plaintext using AES. More...
 
std::string Dwm::Auth::SymCrypto::Encrypt (const std::string &keystr, const std::string &ivstr, const uint8_t *plaintext, size_t plaintextLen)
 Encrypts the given plantextLen bytes of plaintext using AES. More...
 
std::string Dwm::Auth::SymCrypto::Decrypt (const std::string &keystr, const std::string &ivstr, const std::string &ciphertext)
 Decrypts the given ciphertext using AES. More...
 

Detailed Description

Symmetric crypto utility definitions.

Function Documentation

◆ Decrypt()

std::string Dwm::Auth::SymCrypto::Decrypt ( const std::string &  keystr,
const std::string &  ivstr,
const std::string &  ciphertext 
)

Decrypts the given ciphertext using AES.

keystr is ideally 16 bytes long. If shorter, we will pad to 16 bytes by repeating the contents of keystr starting at index 0. ivstr is ideally 16 bytes long. If shorter, we will pad to 16 bytes by repeating the contents of ivstr starting at index 0. Returns the decrypted string.

◆ Encrypt() [1/2]

std::string Dwm::Auth::SymCrypto::Encrypt ( const std::string &  keystr,
const std::string &  ivstr,
const std::string &  plaintext 
)

Encrypts the given plaintext using AES.

keystr is ideally 16 bytes long. If shorter, we will pad to 16 bytes by repeating the contents of keystr starting at index 0. ivstr is ideally 16 bytes long. If shorter, we will pad to 16 bytes by repeating the contents of ivstr starting at index 0. Returns the encrypted string.

◆ Encrypt() [2/2]

std::string Dwm::Auth::SymCrypto::Encrypt ( const std::string &  keystr,
const std::string &  ivstr,
const uint8_t *  plaintext,
size_t  plaintextLen 
)

Encrypts the given plantextLen bytes of plaintext using AES.

keystr is ideally 16 bytes long. If shorter, we will pad to 16 bytes by repeating the contents of keystr starting at index 0. ivstr is ideally 16 bytes long. If shorter, we will pad to 16 bytes by repeating the contents of ivstr starting at index 0. Returns the encrypted string.