Encryption.cpp
//CAESAR CIPHER ALGORITHM           //Currently does not work for lower case alphabets from s onwards

CAESAR CIPHER ALGORITHM           //Currently does not work for lower case alphabets from s onwards
CAESAR CIPHER ALGORITHM // Currently does not work for lower case alphabets from s onwards
void caesarenc(char plt[])
{
    char ch;
    int i, key;
	printf("Enter key: (Number) \n");
	scanf("%d", &key);                          
	for(i = 0; plt[i] != '\0'; i++)
    {
		ch = plt[i];
		if(isalpha(plt[i]))
		{
		if(ch >= 'a' && ch <= 'z')
        {
			ch = (ch + key - 'a') % 26 + 'a'; 
            enc[i] = ch;
		}
		else if(ch >= 'A' && ch <= 'Z')
        {
			ch = ch + key;
			if(ch > 'Z')
            {
				ch = ch - 'Z' + 'A' - 1;
			}
			enc[i] = ch;
		}
		}
		else
		{
			enc[i] = plt[i];
		}
	}
    enc[i] = '\0';
	printf("Encrypted message: %s", enc);                      
}
void caesarenc ( char plt [ ] ) { char ch ; int i , key ; printf ( " \n " ) ; scanf ( " " , & key ) ; for ( i = 0 ; plt [ i ] != ' \0 ' ; i ++ ) { ch = plt [ i ] ; if ( isalpha ( plt [ i ] ) ) { if ( ch >= ' ' && ch <= ' ' ) { ch = ( ch + key - ' ' ) % 26 + ' ' ; enc [ i ] = ch ; } else if ( ch >= ' ' && ch <= ' ' ) { ch = ch + key ; if ( ch > ' ' ) { ch = ch - ' ' + ' ' - 1 ; } enc [ i ] = ch ; } } else { enc [ i ] = plt [ i ] ; } } enc [ i ] = ' \0 ' ; printf ( " " , enc ) ; }
CAESAR CIPHER ALGORITHM           //Currently does not work for lower case alphabets from s onwards
CAESAR CIPHER ALGORITHM // Currently does not work for lower case alphabets from s onwards
//ch = ch + key;
 //if(ch > 'z')
 //{
 //	ch = ch - 'z' + 'a' - 1;
 //}
