main.cpp
//fn to encrypt the plaintext according to the rules of enigma

fn to encrypt the plaintext according to the rules of enigma
fn to encrypt the plaintext according to the rules of enigma
void enigma ::process_plaintext_enigma()
{
    int i;
    int s;
    for (i = 0; i < strlen(plaintext_enigma); i++)
    {
        if (plaintext_enigma[i] < 'A' || plaintext_enigma[i] > 'Z')
        {
            ciphertext_enigma[i] = plaintext_enigma[i];
        }
        else
        {
            s = plaintext_enigma[i] - 65;
            s = R1.look(s, 0);
            s = R2.look(s, 0);
            s = R.reflect(s);
            s = R2.look(s, 1);
            s = R1.look(s, 1);
            ciphertext_enigma[i] = alpha[s];
        }
    }
    ciphertext_enigma[strlen(plaintext_enigma)] = '\0';
}
void enigma :: process_plaintext_enigma ( ) { int i ; int s ; for ( i = 0 ; i < strlen ( plaintext_enigma ) ; i ++ ) { if ( plaintext_enigma [ i ] < ' ' || plaintext_enigma [ i ] > ' ' ) { ciphertext_enigma [ i ] = plaintext_enigma [ i ] ; } else { s = plaintext_enigma [ i ] - 65 ; s = R1 . look ( s , 0 ) ; s = R2 . look ( s , 0 ) ; s = R . reflect ( s ) ; s = R2 . look ( s , 1 ) ; s = R1 . look ( s , 1 ) ; ciphertext_enigma [ i ] = alpha [ s ] ; } } ciphertext_enigma [ strlen ( plaintext_enigma ) ] = ' \0 ' ; }
fn to encrypt the plaintext according to the rules of enigma
fn to encrypt the plaintext according to the rules of enigma
//if the character is not an alphabet no encryption is done
