2
我有下面幾行代碼:檢索文本從ASCII在Matlab中
%for RSA Algorithm
clc;
disp('Implementation of RSA Algorithm');
clear all;
close all;
p = input('\nEnter value of p: ');
q = input('\nEnter value of q: ');
[Pk,Phi,d,e] = init(p,q);
M = input('\nEnter message: ','s');
x=length(M);
c=0;
for j= 1:x
for i=0:122
if strcmp(M(j),char(i))
c(j)=i;
end
end
end
disp('ASCII Code of the entered Message:');
disp(c);
% For Encryption
for j= 1:x
cipher(j)= crypto(c(j),Pk,e);
end
disp('Cipher Text of the entered Message:');
disp(cipher);
我怎麼能知道加密消息的文本?我的意思是加密的特徵是什麼?我想將cipher
的ASCII碼轉換回字符。有人可以告訴我這個matlab代碼嗎?
爲了驗證你的結果,我會在64位的基礎上使用十六進制。 –