Ok,s o my vigenere program sort of works. It encrypts most of the messages properly, but not all. And, of course, I'm not sure what I'm doing wrong. This is the code I have:
Code:
for (int j=0;j<26;j++)
{
if (isspace(KeyString[j]))
{
KeyString[j]=KeyString[j+1];
n=n-1; -----if there is a blank space in the input, this is used to subtract the white space from the length of the string.
k++;-increments to the next
}
else
{
--
EncryptedValue[z] = (PlainText[k] + KeyString[j] - 2*'a') % 26 +'a'; ----------determines what letter to return
z++;---- goes to the next index in the array.
k++;-----increments to the next letter in
i=0;
}
any suggestions? Also, if there is a suggestion I should remove any blank spaces, how does one do so in a array? thanks!