ZNC trunk
Loading...
Searching...
No Matches
CBlowfish Class Reference

does Blowfish w/64 bit feedback, no padding More...

#include <Utils.h>

Public Member Functions

 CBlowfish (const CString &sPassword, int iEncrypt, const CString &sIvec="")
 
 ~CBlowfish ()
 
 CBlowfish (const CBlowfish &)=default
 
CBlowfishoperator= (const CBlowfish &)=default
 
void Crypt (unsigned char *input, unsigned char *output, unsigned int ibytes)
 output must be the same size as input
 
unsigned char * Crypt (unsigned char *input, unsigned int ibytes)
 must free result
 
CString Crypt (const CString &sData)
 

Static Public Member Functions

static unsigned char * MD5 (const unsigned char *input, unsigned int ilen)
 output must be freed
 
static CString MD5 (const CString &sInput, bool bHexEncode=false)
 returns an md5 of the CString (not hex encoded)
 

Detailed Description

does Blowfish w/64 bit feedback, no padding

Constructor & Destructor Documentation

◆ CBlowfish() [1/2]

CBlowfish::CBlowfish ( const CString & sPassword,
int iEncrypt,
const CString & sIvec = "" )
Parameters
sPasswordkey to encrypt with
iEncryptencrypt method (BF_DECRYPT or BF_ENCRYPT)
sIvecwhat to set the ivector to start with, default sets it all 0's

Referenced by CBlowfish(), and operator=().

◆ ~CBlowfish()

CBlowfish::~CBlowfish ( )

◆ CBlowfish() [2/2]

CBlowfish::CBlowfish ( const CBlowfish & )
default

References CBlowfish().

Member Function Documentation

◆ Crypt() [1/3]

CString CBlowfish::Crypt ( const CString & sData)

◆ Crypt() [2/3]

void CBlowfish::Crypt ( unsigned char * input,
unsigned char * output,
unsigned int ibytes )

output must be the same size as input

◆ Crypt() [3/3]

unsigned char * CBlowfish::Crypt ( unsigned char * input,
unsigned int ibytes )

must free result

◆ MD5() [1/2]

static CString CBlowfish::MD5 ( const CString & sInput,
bool bHexEncode = false )
static

returns an md5 of the CString (not hex encoded)

◆ MD5() [2/2]

static unsigned char * CBlowfish::MD5 ( const unsigned char * input,
unsigned int ilen )
static

output must be freed

◆ operator=()

CBlowfish & CBlowfish::operator= ( const CBlowfish & )
default

References CBlowfish().


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