vigenere.m
来自「vigenere密码解密的matlab实现」· M 代码 · 共 19 行
M
19 行
function y = vigenere(txt, key);% This function performs the Vigenere cipher on the plaintext in% the variable txt, using key (we assume the key is in numerical% representation).xln=length(txt);kln=length(key);for j=1:xln, jmod=mod(j,kln); if jmod==0, jmod=kln; end; %map an index of 0 into an index of kln y(j)=shift(txt(j),key(jmod));end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?