Issue #1 #2 #4 are addressed in this commit. Added another window with controls for key management. Simple ASCII encryption

This commit is contained in:
amazing-username
2017-03-27 21:27:28 -05:00
parent 9894385576
commit 3f5d67e4cf
10 changed files with 194 additions and 16 deletions
+4 -5
View File
@@ -4,7 +4,6 @@
GenerateKeys::GenerateKeys()
{
populateDecryptedValues();
populateEncryptedValues();
}
@@ -16,22 +15,22 @@ void GenerateKeys::populateDecryptedValues()
char character;
character = static_cast<char>(number);
if (number >= 97 && number <= 122)
if (number >= startingCharacter && number <= endingCharacter)
{
decryptedCharacters[number] = character;
//std::cout << decryptedCharacters[number] << " ";
}
}
//std::cout << std::endl;
decryptedCharacters[32] = ' ';
decryptedCharacters[whiteSpaceCharacter] = ' ';
}
void GenerateKeys::populateEncryptedValues()
{
for (unsigned short key = 97; key <= 122; key++)
for (unsigned short key = startingCharacter; key <= endingCharacter; key++)
{
encryptedCharacters[decryptedCharacters[key]] = key;
//std::cout << encryptedCharacters[decryptedCharacters[key]] << " ";
}
encryptedCharacters[decryptedCharacters[32]] = 32;
encryptedCharacters[decryptedCharacters[startingCharacter]] = startingCharacter;
//std::cout << std::endl;
}