Type
TForm1 = Class (Tform)
Edit1:tedit;
Button1:tbutton;
Label1:tlabel;
Groupbox1:tgroupbox;
Combobox1:tcombobox;
Label4:tlabel;
Combobox2:tcombobox;
Label3:tlabel;
Combobox3:tcombobox;
Label5:tlabel;
Checkbox1:tcheckbox;
Checkbox2:tcheckbox;
Checkbox3:tcheckbox;
Checkbox4:tcheckbox;
Checkbox5:tcheckbox;
Radiogroup1:tradiogroup;
Image1:timage;
Edit2:tedit;
Procedure Button1Click (Sender:tobject);
Procedure Formcreate (Sender:tobject);
Private
{Private declarations}
Procedure Genpe2006key ();
Public
{Public declarations}
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Const
publickey=63169;
modulus=43679;
Function Crypt (const plngmessage, plngkey:integer): integer;
Var
Llngmod,llngresult,llngindex:integer;
Begin
If plngkey Mod 2 = 0 Then
Begin
Llngresult: = 1;
For llngindex: = 1 to plngkey Div 2 do
Begin
Llngmod: = Round (Power (Plngmessage, 2)) Mod modulus;
Mod may error on key generation
Llngresult: = (Llngmod * llngresult) Mod modulus
End
End
Else
Begin
Llngresult: = Plngmessage;
For llngindex: = 1 to plngkey Div 2 do
Begin
Llngmod: = Round (Power (Plngmessage, 2)) Mod modulus;
Mod may error on key generation
Llngresult: = (Llngmod * llngresult) Mod modulus;
End
End;
Result: = Llngresult;
End;
Function Encode (const pstrmessage:string): String;
Var
Llngindex,llngmaxindex:integer;
Lbytascii:byte;
Llngencrypted:integer;
Begin
Result: = ';
Llngmaxindex: = Length (Pstrmessage);
If llngmaxindex = 0 Then
Exit;
For llngindex: = 1 to Llngmaxindex do
Begin
Lbytascii: = Ord (Pstrmessage[llngindex]);
llngencrypted: = Crypt (Lbytascii, PublicKey);
Result: = result + Inttohex (llngencrypted, 4)
End
End;
Procedure Gen2006key (var st1:string; Const Ssitename,syear,sversion:string;istr:integer);
Var
ssitemd5,sa,scrc:string;
I,k:integer;
Begin
Sa:= ';
ssitemd5:= cmd5.uppermd5 (Cbase64.strtobase64 (ssitename) + cbase64.strtobase64 (sversion));
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.