Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- Key: array[0..7] of byte= ($43 ,$31 ,$43 ,$45 ,$30 ,$39 ,$33 ,$41); { this's not the key but i can't make it longer}
- var
- N,S:String;
- i:integer;
- Cipher: TDCP_des;
- Data: array[0..7] of byte;
- InData: array[0..7] of byte;
- begin
- N := Edit1.text; //N means name - Only accept 6 chars input
- for i:=0 to 7 do
- begin
- InData[i] := ord(N[i+1]);
- Cipher:= TDCP_des.Create(nil);
- Cipher.Init(Key,Sizeof(Key)*8,nil);
- Cipher.EncryptECB(InData,Data);
- end;
- For i:=0 to 7 do
- begin
- S := S + Format('%.2X',[Data[i]]);
- end;
- Edit2.Text := S; // S is Serial
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement