加密字符串111,密匙111,加密后 B9AB03D2E050CB12
加密字符串111,密匙111,解密后 甑.J訁
程序可以运行,但是一个开头是这样的des算法的程序里就是这样了.DES加密解密代码
unit DESCrypt;interface
uses
SysUtils;function EnCrypt(aStr: string; acKey: string ): string; //加密字符串-------------------------------
function DeCrypt(aStr: string; acKey: string ): string; //解密字符串-------------------------------implementationtype
TByte32 = array[1..32] of Byte;
TSData = array[0..63] of Byte;
TBlock = array[0..7] of Byte;const
SA1: TSData =
(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1,
0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1);......加密很正常,但是解密就会出现乱码,出现看不出来的类似汉字的东西,如上
-----------
用这段代码unit des;interfaceuses SysUtils;type
TKeyByte = array[0..5] of Byte;
TDesMode = (dmEncry, dmDecry); function EncryStr(Str, Key: String): String;
function DecryStr(Str, Key: String): String;
function EncryStrHex(Str, Key: String): String;
function DecryStrHex(StrHex, Key: String): String;const
BitIP: array[0..63] of Byte =
(57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7,
56, 48, 40, 32, 24, 16, 8, 0,
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6 );.....加密出乱码 扐蛊o;{D ,解密无东西.请问怎么回事呀?
加密字符串111,密匙111,解密后 甑.J訁
程序可以运行,但是一个开头是这样的des算法的程序里就是这样了.DES加密解密代码
unit DESCrypt;interface
uses
SysUtils;function EnCrypt(aStr: string; acKey: string ): string; //加密字符串-------------------------------
function DeCrypt(aStr: string; acKey: string ): string; //解密字符串-------------------------------implementationtype
TByte32 = array[1..32] of Byte;
TSData = array[0..63] of Byte;
TBlock = array[0..7] of Byte;const
SA1: TSData =
(1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1,
0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1);......加密很正常,但是解密就会出现乱码,出现看不出来的类似汉字的东西,如上
-----------
用这段代码unit des;interfaceuses SysUtils;type
TKeyByte = array[0..5] of Byte;
TDesMode = (dmEncry, dmDecry); function EncryStr(Str, Key: String): String;
function DecryStr(Str, Key: String): String;
function EncryStrHex(Str, Key: String): String;
function DecryStrHex(StrHex, Key: String): String;const
BitIP: array[0..63] of Byte =
(57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7,
56, 48, 40, 32, 24, 16, 8, 0,
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6 );.....加密出乱码 扐蛊o;{D ,解密无东西.请问怎么回事呀?
解决方案 »
- delphi全局变量的问题~
- 軟設考試題(三)
- 你好,怎么样用udp给指定的ip发送消息
- !!!!!!!!!!!!!!木马的来源是ADSL,线路问题或者帐号问题?有可能吗????!!进来看!!
- 键盘上的1、2、3、4、a,A,bB........有没有vk值
- 近来Delphi版的高手都去哪里了?
- 用QReport打印,DataSet属性如何赋值?我用的是DAO
- BORLAND的活动的邀请函
- Image控件存取ACCESS中的圖片問題..
- 请问在delphi中如何调用MultiByteToWideChar等支持Unicode的涵数,希望可以举个例子:),还有请教如果在delphi中转换GB,Big5字符串,也希望有例子,谢谢:)!
- 如何禁止WebBrowser执行脚本?
- 数据库中年月如何处理?
好象是输入了空格什么的,肉眼当然看不出来了。不知道这里会不会也是这个问题。
我同情你