clear all;
close all;
S = 'ONE FIFTH OF THE PEOPLE ARE AGAINST EVERYTHING ALL THE TIME';
P = Plain2Cipher(S);

A = [ 1, 3; 2, 1];
B = InverseModular(A);

if ( isempty(B) )
    disp('ABNORMAL TERMINATION: the encoding matrix has no inverse!');
else
    Q = Encode(P,A);
    SS = Cipher2Plain(Q);
    
    % the inverse procedure: from SS back to S
    P1 = Plain2Cipher(SS);
    Q1 = Decode(P1,B);
    S1 = Cipher2Plain(Q1) % S1 is the same as S, without spaces and with an additional letter at the end
    
end