Added classes for Encryption and Decryption
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#include <ios>
|
||||
|
||||
#include "Encryption.h"
|
||||
#include "GenerateKeys.h"
|
||||
|
||||
Encryption::Encryption()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Encryption::setMessage(const std::string message)
|
||||
{
|
||||
this->message = message;
|
||||
}
|
||||
void Encryption::encryptMessage()
|
||||
{
|
||||
GenerateKeys* gk = new GenerateKeys;
|
||||
writeToFile.open("encryptedFile.txt", std::ios::out);
|
||||
|
||||
for (unsigned short indexOfString = 0; indexOfString < message.size(); indexOfString++)
|
||||
{
|
||||
writeToFile << gk->encryptedCharacters[message.at(indexOfString)];
|
||||
}
|
||||
|
||||
writeToFile.close();
|
||||
|
||||
delete gk;
|
||||
}
|
||||
|
||||
|
||||
std::string Encryption::getMessage() const
|
||||
{
|
||||
return message;
|
||||
}
|
||||
Reference in New Issue
Block a user