Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

I am getting error as " Error using intialize Too many input arguments". "Error in rsa (line 11) [Pk,Phi,d,e] = intialize(p,q,r,s,t,u " i am trying develop an optimized algorithm using the 6 prime numbers to generate encryption

1 view (last 30 days)
lc;
disp('Implementation of RSA Algorithm');
clear all; close all;
p = input('\nEnter the value of p: ');
q = input('\nEnter the value of q: ');
r = input('\nEnter the value of r: ');
s = input('\nEnter the value of s: ');
t = input('\nEnter the value of t: ');
u = input('\nEnter the value of u: ');
[Pk,Phi,d,e] = intialize(p,q,r,s,t,u);
M = input('\nEnter the 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);
% % %Encryption
h = cputime;
for j= 1:x
cipher(j)= crypt(c(j),Pk,e);
end
disp('Cipher Text of the entered Message:');
disp(cipher);
encrypt_time = cputime-h
% % %Decryption
v = cputime;
for j= 1:x
message (j)= crypt(cipher(j),Pk,d);
end
disp('Decrypted ASCII of Message:');
disp(message);
decrypt_time = cputime-v
disp(['Decrypted Message is: ' message]);

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!