rsa_dec.asv
来自「RSA encrption algorithms」· ASV 代码 · 共 27 行
ASV
27 行
function RSA_DEC
format long
load('RSA','Cipher text','n','e');
maple('n1:=',n);
maple('e1:=',e);
%compute olar function .
Qn=olar(n);
maple('Qn1:=',Qn);
%compute private key
d=maple('(e1) &^(-1) mod (Qn1)');
d=str2double(d);
maple('d1:=',d);
%%%%%%%%%%%%%%
% Decryption %
%%%%%%%%%%%%%%
plaintext=[];
for i=1:1:count
maple('C1:=',Ciphertext(i));
m=maple('(C1) &^(d1) mod (n1)');
m=str2double(m);
plaintext=[plaintext m];
end
fid=fopen('decmessage.txt','w');
fwrite(fid,plaintext);
fclose(fid);
open 'decmessage.txt';
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?