So far, I've managed to make Vigenere Cipher work well, but my key always encounters a problem if it has uppercase character.
for (int i = 0, b = 0, n = strlen(phrase); i < n; i++, b++)
{
if (isalpha(phrase[i]))
{
shift = tolower(key[b % strlen(key)]) - 'a';
cipher = phrase[i] + shift;
}
Basically, shift is an integer that finds the integer equivalent of the current character in the keyword. Which I add to the current char in the phrase. Inside the formula for shift, its set to automatically make that specific char lowercase, to simplify the process, but it doesn't seem to work. If needed for clarification, I will post the rest of the for loop, but I think this is the main problem.
PS: Sorry if my code seems kind of confusing, or has bad style, I just want to make sure it works, before making it more efficient. Thanks so much in advance.