main.cpp
//fn that performs encryption acccording to the rules of vigenere cipher(to know working of cipher, refer to readme)

fn that performs encryption acccording to the rules of vigenere cipher(to know working of cipher, refer to readme)
fn that performs encryption acccording to the rules of vigenere cipher ( to know working of cipher refer to readme )
void vig::vigprocess()
{
    vigmatrice();
    cout << "Enter a message:\n";
    fflush(stdin);
    gets(ciphertext_vig);
    strcpy(plaintext_vig, ciphertext_vig);
    cout << "Enter key:\n";
    fflush(stdin);
    gets(key);
    char tempkey[30];
    strcpy(tempkey, key);
    cout << "\nThe encrypted message is: ";
    int i, o = 0;
    for (i = 0; i < strlen(ciphertext_vig); i++)
        ciphertext_vig[i] = toupper(ciphertext_vig[i]);
    for (i = 0; i < strlen(key); i++)
    {
        key[i] = toupper(key[i]);
        if (key[i] < 'A' || key[i] > 'Z')
            continue;
        tempkey[o++] = key[i];
    }
    tempkey[o] = '\0';
    strcpy(key, tempkey);
    int l = strlen(key);
    for (i = 0; i < strlen(ciphertext_vig); i++)
    {
        if (ciphertext_vig[i] >= 'A' && ciphertext_vig[i] <= 'Z')
        {
            int word_letter = ciphertext_vig[i] - 65;
            int cipher_letter = key[i % l] - 65;
            ciphertext_vig[i] = cipher[word_letter][cipher_letter];
        }
        cout << ciphertext_vig[i];
    }
    cout << "\n\nEnter any key to know about the working of VIGNERE CIPHER";
    char ch;
    cin >> ch;
    display_vig();
}
void vig :: vigprocess ( ) { vigmatrice ( ) ; cout << " \n " ; fflush ( stdin ) ; gets ( ciphertext_vig ) ; strcpy ( plaintext_vig , ciphertext_vig ) ; cout << " \n " ; fflush ( stdin ) ; gets ( key ) ; char tempkey [ 30 ] ; strcpy ( tempkey , key ) ; cout << " \n " ; int i , o = 0 ; for ( i = 0 ; i < strlen ( ciphertext_vig ) ; i ++ ) ciphertext_vig [ i ] = toupper ( ciphertext_vig [ i ] ) ; for ( i = 0 ; i < strlen ( key ) ; i ++ ) { key [ i ] = toupper ( key [ i ] ) ; if ( key [ i ] < ' ' || key [ i ] > ' ' ) continue ; tempkey [ o ++ ] = key [ i ] ; } tempkey [ o ] = ' \0 ' ; strcpy ( key , tempkey ) ; int l = strlen ( key ) ; for ( i = 0 ; i < strlen ( ciphertext_vig ) ; i ++ ) { if ( ciphertext_vig [ i ] >= ' ' && ciphertext_vig [ i ] <= ' ' ) { int word_letter = ciphertext_vig [ i ] - 65 ; int cipher_letter = key [ i % l ] - 65 ; ciphertext_vig [ i ] = cipher [ word_letter ] [ cipher_letter ] ; } cout << ciphertext_vig [ i ] ; } cout << " \n \n " ; char ch ; cin >> ch ; display_vig ( ) ; }
fn that performs encryption acccording to the rules of vigenere cipher(to know working of cipher, refer to readme)
fn that performs encryption acccording to the rules of vigenere cipher ( to know working of cipher refer to readme )
//loop to make all alphabets in input to upper case for ease of encryption
 //loop to convert all characters in key to upper case and validate that the key has only alphabets
