Added classes for Encryption and Decryption

This commit is contained in:
amazing-username
2017-03-24 13:00:56 -05:00
parent 80d6d20b16
commit adc92aae29
13 changed files with 375 additions and 19 deletions
+37
View File
@@ -0,0 +1,37 @@
#include <iostream>
#include "GenerateKeys.h"
GenerateKeys::GenerateKeys()
{
populateDecryptedValues();
populateEncryptedValues();
}
void GenerateKeys::populateDecryptedValues()
{
for (unsigned short number = 0; number < 300; number++)
{
char character;
character = static_cast<char>(number);
if (number >= 97 && number <= 122)
{
decryptedCharacters[number] = character;
//std::cout << decryptedCharacters[number] << " ";
}
}
//std::cout << std::endl;
decryptedCharacters[32] = ' ';
}
void GenerateKeys::populateEncryptedValues()
{
for (unsigned short key = 97; key <= 122; key++)
{
encryptedCharacters[decryptedCharacters[key]] = key;
//std::cout << encryptedCharacters[decryptedCharacters[key]] << " ";
}
encryptedCharacters[decryptedCharacters[32]] = 32;
//std::cout << std::endl;
}