Created
June 12, 2019 20:47
-
-
Save Raniita/091b5ce338f5659ea8652fdaf62663bb to your computer and use it in GitHub Desktop.
polybius cipher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [msg_cifrado] = polybius(msg, clave) | |
% msg -> msg a TX | |
% clave -> matriz para seguir el cifrado | |
msg_cifrado = ''; | |
for i=1:length(msg) | |
% Buscamos el caracter | |
cipher_matrix = strfind(clave, msg(i)); | |
[row,col] = find(not(cellfun('isempty',cipher_matrix))); | |
msg_cifrado = strcat(msg_cifrado,num2str(row),num2str(col)); | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment