الورش التدريبية ذات اليوم الواحد وتعقد عن بعد.. هي فرصة للاطفال الاشتراك فيها وهم داخل المنزل
clc; clear all;
close all
p = input('enter plaintext: ', 's');
p = lower(p);
lp = length(p);
for i = 1:lp
c(i) = int16(p(i)) - 97 + 3;
End
c = mod(c, 26) + 65;
c = char(c)
clc; clear all;
close all
c = input('enter ciphertext: ', 's');
c = upper(c);
lc = length(c);
for i = 1:lc
p(i) = int16(c(i)) - 65 - 3;
end
p = mod(p, 26) + 97;
p = char(p)
clc; clear all; close all
p = input('enter plaintext: ', 's');
p = lower(p);
a = input('enter value a= ');
if gcd(a, 26) ~= 1
disp(['The key "a" not relatively prime to 26'])
else
b = input('enter value b= ');
lp = length(p);
for i = 1:lp
r = int16(p(i)) - 97;
c(i) = mod((r * a) + b, 26);
end
c = char(c + 65);
disp(['The ciphertext : ' c])
end
clc; clear all; close all
c = input('enter ciphertext: ', 's');
c = upper(c);
a = input('enter value a= ');
b = input('enter value b= ');
lc = length(c);
a1 = [1 3 5 7 9 11 15 17 19 21 23 25];
a2 = [1 9 21 15 3 19 7 23 11 5 17 25];
s = 0;
for i = 1:12
if a1(i) == a
s = i;
end
end
ia = a2(s);
for i = 1:lc
v = int16(c(i)) - 65;
p(i) = mod((ia * (v - b)), 26);
end
p = char(p + 97);
disp(['The plaintext : ' p])