% Code is for Octave
%-----------------------------------%
%                                   %
% (C) 2014 - Michael K. Pellegrino  %
%                                   %
% My implementation of a Hill       %
% Cipher decryption key calculator. %
%                                   %
% usage: getkey( EncryptionKey )    %
%                                   %
%-----------------------------------%
function ret=getkey( M )
  ret=mod( imod( det(M), 61 ) * cofactor( M )', 61 );
endfunction
