比较像是DES加密的,DES加密需要密钥。
你如果需要加密成一模一样的,就需要知道这个密钥。
你如果需要加密成一模一样的,就需要知道这个密钥。
解决方案 »
- TreeView上的一个节点拖下来,放到GroupBox里面
- 请问哪里有可以播放flash的控件?
- 给你锻炼的机会来了,取名小行动~~~~~~~~~~~~~~~~
- Delphi时间问题,请指教!
- 我的BDE打开ODBC的时候需要我密码登陆~~急!!!!!!
- 有谁做过进销存软件吗?这个问题么样解决?给分么,只要解决了你要多少我给多少!!!
- 时间查询的问题
- 各位高手,我只需要有20个客户端同时使用一个程序来对服务器的数据库信息进行单据录入,修改等,该用两层还是三层的技术啊?
- 急急急!!!遍登陆窗口时出现的问题
- 字符串如何超过255个?
- 求助!!dephi里如何让一列的值居中显示
- 关于cxGridTableView表格按照某列进行排序后,结果发现DataController 里面的数据没有排序。怎么解决?
function Encrypt(Url: string): string;
const
Map: array[0..7] of Byte = ($B2, $09, $BB, $55, $93, $6D, $44, $47);
var
I, Len, MapIndex: Integer;
Value: Byte;
begin
Result := '';
MapIndex := 0;
Len := Length(Url);
for I := 1 to Len do
begin
Value := Ord(Url[I]) xor Map[MapIndex];
Result := Result + IntToHex(Value, 2);
Inc(MapIndex);
if MapIndex >= Length(Map) then
MapIndex := 0;
end;
end;
begin
ShowMessage(Encrypt('www.csdn.net')); // C57ECC7BF01E20299C67DE21
end;
大神是这样的,我是偷别人的一个小型浏览器,他浏览器调用ini文件,ini文件内的域名位置调用代码!
delphi xe5?是吗?你引用SysUtils了吗?
delphi xe5?是吗?你引用SysUtils了吗?
大神别骂我哈,我对delphi 不是很懂!
报什么错误呢?
报什么错误呢?大神,我现在能说,我连引用 uses SysUtils 还没搞定么
报什么错误呢?大神,我现在能说,我连引用 uses SysUtils 还没搞定么大神您能不能好人做到底,教一下如何引用?
SysUtils;
function Encrypt(Url: string): string;
const
Map: array[0..7] of Byte = ($B2, $09, $BB, $55, $93, $6D, $44, $47);
var
I, Len, MapIndex: Integer;
Value: Byte;
begin
Result := '';
MapIndex := 0;
Len := Length(Url);
for I := 1 to Len do
begin
Value := Ord(Url[I]) xor Map[MapIndex];
Result := Result + IntToHex(Value, 2);
Inc(MapIndex);
if MapIndex >= Length(Map) then
MapIndex := 0;
end;
end;这样么? 现在运行显示这个Declaration expected but end of file found
uses
SysUtils;
function Encrypt(Url: string): string;
const
Map: array[0..7] of Byte = ($B2, $09, $BB, $55, $93, $6D, $44, $47);
var
I, Len, MapIndex: Integer;
Value: Byte;
begin
Result := '';
MapIndex := 0;
Len := Length(Url);
for I := 1 to Len do
begin
Value := Ord(Url[I]) xor Map[MapIndex];
Result := Result + IntToHex(Value, 2);
Inc(MapIndex);
if MapIndex >= Length(Map) then
MapIndex := 0;
end;
end.我目前是这样写的,运行还是有问题,郁闷了!!!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}function Encrypt(Url: string): string;
const
Map: array[0..7] of Byte = ($B2, $09, $BB, $55, $93, $6D, $44, $47);
var
I, Len, MapIndex: Integer;
Value: Byte;
begin
Result := '';
MapIndex := 0;
Len := Length(Url);
for I := 1 to Len do
begin
Value := Ord(Url[I]) xor Map[MapIndex];
Result := Result + IntToHex(Value, 2);
Inc(MapIndex);
if MapIndex >= Length(Map) then
MapIndex := 0;
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(Encrypt('www.csdn.net')); // C57ECC7BF01E20299C67DE21
end;end.
大神 万谢了,可以运行了,能不能问最后一个问题?如何让ShowMessage(Encrypt('www.csdn.net')); // C57ECC7BF01E20299C67DE21 密文 变成我所需要的域名密文?
大神 万谢了,可以运行了,能不能问最后一个问题?如何让ShowMessage(Encrypt('www.csdn.net')); // C57ECC7BF01E20299C67DE21 密文 变成我所需要的域名密文?
大神,我想应该是在Byte = ($B2, $09, $BB, $55, $93, $6D, $44, $47);这个位置,但是这个位置是16进制代码转换byte的吗?还是其他的,能否告知一下?
const
Map: array[0..7] of Byte = ($B2, $09, $BB, $55, $93, $6D, $44, $47);
var
I, Len, MapIndex: Integer;
Value: Byte;
begin
Result := '';
MapIndex := 0;
I := 1;
Len := Length(Ciphertext);
while I < Len do
begin
Value := StrToInt('$' + Ciphertext[I] + Ciphertext[I + 1]) xor Map[MapIndex];
Result := Result + Chr(Value);
Inc(I, 2);
Inc(MapIndex);
if MapIndex >= Length(Map) then
MapIndex := 0;
end;
end;
实在是不了解,没学习过软件,真的不好意思啊,刚刚以为那个位置是16进制进行转换的,但是转换出来的还是无法访问,随后就看了看代码上所写的,string Byte 这两个,应该是 string为密匙或者依照他的算法进行转换byte,现在我不是很明白string的算法是怎么进行的!