Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cCipherText Class Reference

#include <cCipherText.h>

Public Member Functions

 cCipherText (cCipherBase *pCipher)
 
 ~cCipherText ()
 
HRESULT EncryptText (const void *pszSrc, size_t nSrcSize, char *pszDst, StrLen_t iDstMaxLen) const
 
HRESULT DecryptText (const char *pszSrc, StrLen_t nSrcSize, void *pszDst, size_t iDstMaxLen) const
 
cStringA EncryptText (const char *pszSrc, StrLen_t nSrcSize=-1) const
 
cStringA DecryptText (const char *pszSrc, StrLen_t nSrcSize=-1) const
 
 UNITTEST_FRIEND (cCipherText)
 

Detailed Description

helper class to encrypt binary data to cBase64 coded string. allow decrypt of same cBase64 string back to binary raw data. i.e. the encrypted result is a string. using any cCipherBase based algorithm

Constructor & Destructor Documentation

◆ cCipherText()

GrayLib::cCipherText::cCipherText ( cCipherBase pCipher)

◆ ~cCipherText()

GrayLib::cCipherText::~cCipherText ( )

Member Function Documentation

◆ DecryptText() [1/2]

HRESULT GrayLib::cCipherText::DecryptText ( const char *  pszSrc,
StrLen_t  nSrcSize,
void *  pszDst,
size_t  iDstMaxLen 
) const

Take uucoded and encrypted data and un-uucode then decrypt it to original binary data. might be text results of course.

Returns
size in bytes of the output. <= 0 = failure. buffer not big enough!

◆ DecryptText() [2/2]

cStringA GrayLib::cCipherText::DecryptText ( const char *  pszSrc,
StrLen_t  nSrcSize = -1 
) const

We just assume the decrypted thing is text. it might not be ? nSrcLen = -1 = until '\0'

◆ EncryptText() [1/2]

cStringA GrayLib::cCipherText::EncryptText ( const char *  pszSrc,
StrLen_t  nSrcSize = -1 
) const

◆ EncryptText() [2/2]

HRESULT GrayLib::cCipherText::EncryptText ( const void *  pszSrc,
size_t  nSrcSize,
char *  pszDst,
StrLen_t  iDstMaxLen 
) const

Encrypt original binary data then return the result as cBase64 text. pSrc does not have to be text. can be binary.

Returns
pszDst = null terminated string. length of the encrypted/UU coded string in chars <= 0 = failure. buffer not big enough!

◆ UNITTEST_FRIEND()

GrayLib::cCipherText::UNITTEST_FRIEND ( cCipherText  )

The documentation for this class was generated from the following files: