% Tutorial for computing matrix inverses, mod 26
% Matt Boutell, Spring 2009

% Take M = |7 3|
%          |4 9|
M = [7 3; 4 9]

cipher = hillEncrypt(M, 'failuresarefingerpostsontheroadtoachievement', 0)
pause
% jpwtafwsqxwfelgcxeowxludfqsjuqtyuqqruihvwulc
% We want to compute M^(-1) (mod 26)
verbose = 0;
Minv = matrixModularInverse(M, 0);

plain = hillEncrypt(Minv, cipher, 0)
