---===:::Turbo Pascal ,::===---源代码地址:http://tieba.baidu.com/f?ct=335675392&tn=baiduPostBrowser&sc=4403417012&z=437518845&pn=0&rn=50&lm=0&word=pascal#4403417012我发了三遍谁看看算法 加密算法(KE)是正确的!解密算法(DE

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 07:07:57
---===:::Turbo Pascal ,::===---源代码地址:http://tieba.baidu.com/f?ct=335675392&tn=baiduPostBrowser&sc=4403417012&z=437518845&pn=0&rn=50&lm=0&word=pascal#4403417012我发了三遍谁看看算法 加密算法(KE)是正确的!解密算法(DE
xVOVW8;LPi~po'u@Tk:UE H£&vSk;NB&E=s~c,KU1L* J2wstJm)**ɢbhդ+ʹ\P!w9&C?! sT9Ot&Bfx8_ٖK.cfkh'Q[z>l.4[9ݻzWX7Oy{vZN_nu+OI} ^ |y4|慐qi띭o6ߡepͲpz;Q?z EI"AfP 0=pBB fs}c۫0iB3Oj"E!>i"A ;\%pMdž@QIbe7wq-'1!jed.$B@ړgnvX(s]pgRL0aMVE1MQX$\)}hE9XpOQʭ8/{p#xK^j4؊5(-

---===:::Turbo Pascal ,::===---源代码地址:http://tieba.baidu.com/f?ct=335675392&tn=baiduPostBrowser&sc=4403417012&z=437518845&pn=0&rn=50&lm=0&word=pascal#4403417012我发了三遍谁看看算法 加密算法(KE)是正确的!解密算法(DE
---===:::Turbo Pascal ,::===---
源代码地址:http://tieba.baidu.com/f?ct=335675392&tn=baiduPostBrowser&sc=4403417012&z=437518845&pn=0&rn=50&lm=0&word=pascal#4403417012
我发了三遍
谁看看算法
加密算法(KE)是正确的!
解密算法(DEKE)是错误的!
这个加密程序用了关建字加密
一种单字母替换加密
例:关键字是cat 那么可以写出字母表
原文:a b c d e f g h i j k l m n o p q r s t u v w x y z
密文:c a t b d e f g h i j k l m n o p q r s u v w x y z
谁能将此程序的解密过程修改,使之解密正常(成为加密的逆运算)答案好加分!

---===:::Turbo Pascal ,::===---源代码地址:http://tieba.baidu.com/f?ct=335675392&tn=baiduPostBrowser&sc=4403417012&z=437518845&pn=0&rn=50&lm=0&word=pascal#4403417012我发了三遍谁看看算法 加密算法(KE)是正确的!解密算法(DE
program GSdcd (input,output,f1,f2);
label
1,2,3,4,5,322;
var
opt,howdecode,useord,i,j:byte;
odc,ndc:char;
f1,f2:text;
ipath,opath,y:string;
procedure ke;
var
lng:byte;
charlng,tmpw:char;
begin
lng:=length(y);
charlng:=chr(lng+96);
for i:=1 to pred(lng) do
for j:=succ(i) to lng do
if y[i]=y[j] then begin
writeln('Keyword ERROR!Now Exit');
readln;
halt;
end;
tmpw:='a';
for i:=(lng+1) to 26 do
begin
while pos(tmpw,y)0 do
tmpw:=succ(tmpw);
y[i]:=tmpw;
tmpw:=succ(tmpw);
end;
end;
procedure deke;
type
worb=array['a'..'z']of char;
var
z:worb;
lng:byte;
charlng,tmpw,tmpchar:char;
begin
lng:=length(y);
charlng:=chr(lng+96);
for i:=1 to pred(lng) do
for j:=succ(i) to lng do
if y[i]=y[j] then begin
writeln('Keyword ERROR!Now Exit');
readln;
halt;
end;
tmpw:='a';
for i:=(lng+1) to 26 do
begin
while pos(tmpw,y)0 do
tmpw:=succ(tmpw);
y[i]:=tmpw;
tmpw:=succ(tmpw);
end;
for i:=1 to 26 do
begin
tmpchar:=y[i];
tmpw:=chr(i+96);
z[tmpchar]:=tmpw;
end;
end;
begin
writeln('GSdcd Version 5.0 Copyright © 2007-2008 GSoft');
writeln;
write('Input Filepath:');
readln(ipath);
write('Output Filepath:');
readln(opath);
assign(f1,ipath);
assign(f2,opath);
reset(f1);
rewrite(f2);
writeln('How to Decode?:1.Xrd / DeXrd');
writeln(' 2.Axd');
writeln(' 3.DeAxd');
writeln(' 4.Keyword Encryption');
writeln(' 5.DeKeyword Encryption');
write('Please Write Your Choice (Number):');
readln(howdecode);
case howdecode of
1:goto 1;
2:goto 2;
3:goto 3;
4:goto 4;
5:goto 5;
else begin
writeln('Error of Your Choise!Now Exit');
readln;
exit;
end;
end;
4:write('Keyword(English Small Letter Combination):');
readln(y);
ke;
while not eof(f1) do
begin
read(f1,odc);
if (odc>='A') and (odc='A') and (odc