MIRA
|
The security component of MIRA contains the following functions:
MIRA implements a template based generic hash stream (see HashStream) and three standard hash streams (see MD5, SHA1 and SHA256).
To put data in a hash stream, the standard << operator can be used. To get the resulting hash value, the function getDigest has to be used.
Example:
To create and handle RSA keys, the class RSAKey can be used.
The implementation of the RSA encryption and decryption is based on the boost::iostreams
.
Encryption of some data with a public key can be done like this:
To decrypt the data with the private key, the following has to be done:
MIRA also supports signing and verifying messages using an RSA public/private key pair by means of the class RSASignature.
To sign a message, the method mira::RSASignature::signMessage has to be used.
To verify the integrity of a message signature, the function mira::RSASignature::verifyMessage can be used.
The implementation of the AES encryption and decryption is based on the boost::iostreams
.
Encryption of some data can be done like this:
To decrypt the data, the following has to be done: