📄 rsa_dec.asv
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -