Logo Search packages:      
Sourcecode: pwlib version File versions

PCypher Class Reference

#include <cypher.h>

Inheritance diagram for PCypher:

PObject PTEACypher

List of all members.

Detailed Description

This abstract class defines an encryption/decryption algortihm. A specific algorithm is implemented in a descendent class.

Definition at line 538 of file cypher.h.

Comparison functions

enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
virtual Comparison Compare (const PObject &obj) const
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

I/O functions

virtual void PrintOn (ostream &strm) const
virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Public Types

enum  BlockChainMode {
  ElectronicCodebook, ECB = ElectronicCodebook, CypherBlockChaining, CBC = CypherBlockChaining,
  OutputFeedback, OFB = OutputFeedback, CypherFeedback, CFB = CypherFeedback,
 Mechanism by which sequential blocks are linked.

Public Member Functions

BOOL Decode (const PBYTEArray &coded, PBYTEArray &clear)
PINDEX Decode (const PBYTEArray &coded, void *data, PINDEX length)
PINDEX Decode (const PString &cypher, void *data, PINDEX length)
BOOL Decode (const PString &cypher, PBYTEArray &clear)
BOOL Decode (const PString &cypher, PString &clear)
PString Decode (const PString &cypher)
void Encode (const void *data, PINDEX length, PBYTEArray &coded)
void Encode (const PBYTEArray &clear, PBYTEArray &coded)
PString Encode (const void *data, PINDEX length)
PString Encode (const PBYTEArray &clear)
PString Encode (const PString &str)
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const

Protected Member Functions

virtual void DecodeBlock (const void *in, void *out)=0
virtual void EncodeBlock (const void *in, void *out)=0
virtual void Initialise (BOOL encoding)=0
 PCypher (const void *keyData, PINDEX keyLength, PINDEX blockSize, BlockChainMode chainMode)
 PCypher (PINDEX blockSize, BlockChainMode chainMode)

Protected Attributes

PINDEX blockSize
 Size of each encryption block in bytes.
BlockChainMode chainMode
 Mode for sequential encryption each block.
PBYTEArray key
 Key for the encryption/decryption.

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

Generated by  Doxygen 1.6.0   Back to index