那位兄弟有比较好的加密模块? RT。。最好能够根据密钥来进行加密和解密的。因为是用于网络传输,所以不希望输出的文本比要加密的文本的长度多几十倍。。呵呵,偶以前就写过一个这样的加密模块,加密后的长度是加密前的20多倍。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 加密/解密一个字符串{ Begin code }program Crypt;uses WinCRT;const C1 = 52845; C2 = 22719;function Encrypt(const S: String; Key: Word): String;var I: byte;begin Result[0] := S[0]; for I := 1 to Length(S) do begin Result[I] := char(byte(S[I]) xor (Key shr 8)); Key := (byte(Result[I]) + Key) * C1 + C2; end;end;function Decrypt(const S: String; Key: Word): String;var I: byte;begin Result[0] := S[0]; for I := 1 to Length(S) do begin Result[I] := char(byte(S[I]) xor (Key shr 8)); Key := (byte(S[I]) + Key) * C1 + C2; end;end;var S: string;begin Write('>'); ReadLn(S); S := Encrypt(S,12345); WriteLn(S); S := Decrypt(S,12345); WriteLn(S);end. 如何限制窗口移动? 急急,在线等,没碰过的问题,连接不了数据库。 xlgrid的打印问题 求助:有没有不需要BDE就可以访问paradox或dbf,Foxpro的控件?有答案就立刻结帖! 字符串问题? 关于ftp 如何隐藏鼠标 delphi使用USB的问题 有没有东莞长安的Coder 求教在指定位置弹出系统菜单的具体用法!分可加。。。 怎样在状态条上加上进度条 请教ShFileOperation如何操作多个目录?
{ Begin code }
program Crypt;
uses WinCRT;
const
C1 = 52845;
C2 = 22719;
function Encrypt(const S: String; Key: Word): String;
var
I: byte;
begin
Result[0] := S[0];
for I := 1 to Length(S) do begin
Result[I] := char(byte(S[I]) xor (Key shr 8));
Key := (byte(Result[I]) + Key) * C1 + C2;
end;
end;function Decrypt(const S: String; Key: Word): String;
var
I: byte;
begin
Result[0] := S[0];
for I := 1 to Length(S) do begin
Result[I] := char(byte(S[I]) xor (Key shr 8));
Key := (byte(S[I]) + Key) * C1 + C2;
end;
end;var
S: string;
begin
Write('>');
ReadLn(S);
S := Encrypt(S,12345);
WriteLn(S);
S := Decrypt(S,12345);
WriteLn(S);
end.