Cryptography Reference
In-Depth Information
return verification;
}
The class implementations RSAkey and RSApub contain in addition the following
operators, which are not discussed further here:
RSAkey& operator= (const RSAkey&);
friend int operator== (const RSAkey&, const RSAkey&);
friend int operator!= (const RSAkey&, const RSAkey&);
friend fstream& operator<< (fstream&, const RSAkey&);
friend fstream& operator>> (fstream&, RSAkey&);
and
RSApub& operator= (const RSApub&);
friend int operator== (const RSApub&, const RSApub&);
friend int operator!= (const RSApub&, const RSApub&);
friend fstream& operator<< (fstream&, const RSApub&);
friend fstream& operator>> (fstream&, RSApub&);
These are for elementwise allocation, tests for equality and inequality, as well
as reading and writing of keys to and from mass storage. However, one must note
that the private key components are stored in plain text, just as the public key is.
For a real application the secret keys must be stored in encrypted form and in a
secure environment.
There are also the member functions
RSAkey::purge (void),
RSApub::purge (void),
which delete keys by overwriting their LINT components with zeros. The
formatting of message blocks for encryption or signing corresponding to the
PKCS #1 specification is taken over by the function
UCHAR* format_pkcs1 (const UCHAR* EB, int LenEB,
UCHAR BlockType, const UCHAR* Data, int LenData);
The analysis of decrypted message blocks for verifying the format and for the
extraction of useful data is handled by the function
int parse_pkcs1 (UCHAR*& PayLoad, const UCHAR* EB, int* LenData);
 
Search WWH ::




Custom Search