---------关于RSA算法的Delphi源代码(下载)----------(200分)

  • 主题发起人 拓荒国
  • 开始时间

拓荒国

Unregistered / Unconfirmed
GUEST, unregistred user!
RSA加密算法(Delphi版) -----免费下载地址:
http://www.playicq.com/dispdocnew.php?t=&id=2463
它自带的Demo产生的最后Test的值在Delphi里面显示是乱码,
不知道哪位大虾用过,还望请教,谢谢!
up有分哦:)
 
我试了一下,没有问题呀。

test := 'eagles may soar high, but weaslesdo
not get sucked into jet engines';
RSAEncrypt(test, e, n, test);
ShowMessage(test);
//********************show 1*********************
RSADecrypt(test, d, n, Nilgint, Nilgint, Nilgint, Nilgint, test);
// this Is faster : RSADecrypt(test, nilGInt, n, dp, dq, p, q, test);
RSASign(test, d, n, Nilgint, Nilgint, Nilgint, Nilgint, signature);
// this Is faster : RSASign(test, nilgint, n, dp, dq, p, q, signature);
RSAVerify(test, signature, e, n, ok);
ShowMessage(test);
//********************show 2*********************
我在代码中加了两条语句用于显示加密后以及解密后的字符串(show 1以及show 2),在
show 2 处的字符串已经被成功还原了。
 
用function EncryStrHex(Str, Key: string): string;

/////////////////DES加密算法////////////////////////////
function EncryStr(Str, Key: string): string;
//加密
function EncryStrHex(Str, Key: string): string;
//以十六进制加密(有些时侯加密的密文含有特殊字符文本框不能显示、
//数据库文本字段也不能存储。以十六进制形式表示可保证绝对不会出现该种情况)
function DESryStr(Str, Key: string): string;
//解密
function DESryStrHex(StrHex, Key: string): string;
//解密十六进制加密的密文
 
creation-zy:
还是乱码呀:
test:陊?瑁Sc啐辡<踤fVw覕汬O8砧ィ弴娕桅搳*涴C?≡?MP狁f?∧+肴l<脕g2h6?un
你前面的几个pq,n参数是什么呀?我的:
Base10StringToFGInt('102336547456161301', p);
PrimeSearch(p);
Base256StringToFGInt('AEFAFGhdhsgoi!?ty!a', q);
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部