有關aes的問題?是之前有人發問過的問題。不好意思,我是新手,想學 |
答題得分者是:wameng
|
paa
初階會員 發表:50 回覆:101 積分:30 註冊:2005-02-01 發送簡訊給我 |
unit Unit1; interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls; type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1;
const
StartKey = 981; {Start default key}
MultKey = 12674; {Mult default key}
AddKey = 35891; {Add default key} function Encrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
function Decrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
implementation
{$R-}
{$Q-}
{*******************************************************
* Standard Encryption algorithm - Copied from Borland *
*******************************************************}
function Encrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
var
I : Byte;
begin
Result := '';
for I := 1 to Length(InString) do
begin
Result := Result CHAR(Byte(InString[I]) xor (StartKey shr 8));
StartKey := (Byte(Result[I]) StartKey) * MultKey AddKey;
end;
end;
{*******************************************************
* Standard Decryption algorithm - Copied from Borland *
*******************************************************}
function Decrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
var
I : Byte;
begin
Result := '';
for I := 1 to Length(InString) do
begin
Result := Result CHAR(Byte(InString[I]) xor (StartKey shr 8));
StartKey := (Byte(InString[I]) StartKey) * MultKey AddKey;
end;
end;
{$R }
{$Q }
procedure TForm1.Button1Click(Sender: TObject);
var s:string;
begin
s:=Encrypt(edit1.text,38383,383838,383838);
edit2.text:=s;
edit3.text:=Decrypt(s,38383,383838,383838);
end;
end.
我想問的是怎麼跑的時候出現project project1.exe raised exception class EResNotFound with message'Resource TForm1 not found'.process stopped.use stepor Run to continue.
在button那,edit2後面的38383,383838,383838是指什麼意思啊?
|
wameng
版主 發表:31 回覆:1336 積分:1188 註冊:2004-09-16 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |