Disini aku memakai sebuah komponen freeware berjulukan DCPCrypt (link situsnya disini), anda tinggal d0wnl0ad dan installkan komponennya. Setelah itu anda buat sebuah project gres dengan satu form, 3 edit box, dan 2 button. Lalu terakhir ketikan isyarat berikut ini:
procedure TForm1.Button1Click(Sender: TObject);
var
S1: String;
c: TDCP_rijndael;
begin
c := TDCP_rijndael.Create(nil);
try
c.InitStr('MyKey', TDCP_sha256); //Bisa diganti MD5, SHA512
S1 := c.EncryptString(edit1.Text);
c.Reset;
finally
c.Free;
end;
edit2.Text:=s1;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
S1: String;
c: TDCP_rijndael;
begin
c := TDCP_rijndael.Create(nil);
try
c.InitStr('MyKey', TDCP_sha256); //Bisa diganti MD5, SHA512
S1 := c.DecryptString(edit2.Text);
c.Reset;
finally
c.Free;
end;
edit3.Text:=s1;
end;
Source: http://forum.lazarus.freepascal.org/index.php?topic=10970.0
Semoga bermanfaat. Sumber http://farihinmuhamad.blogspot.com
procedure TForm1.Button1Click(Sender: TObject);
var
S1: String;
c: TDCP_rijndael;
begin
c := TDCP_rijndael.Create(nil);
try
c.InitStr('MyKey', TDCP_sha256); //Bisa diganti MD5, SHA512
S1 := c.EncryptString(edit1.Text);
c.Reset;
finally
c.Free;
end;
edit2.Text:=s1;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
S1: String;
c: TDCP_rijndael;
begin
c := TDCP_rijndael.Create(nil);
try
c.InitStr('MyKey', TDCP_sha256); //Bisa diganti MD5, SHA512
S1 := c.DecryptString(edit2.Text);
c.Reset;
finally
c.Free;
end;
edit3.Text:=s1;
end;
Source: http://forum.lazarus.freepascal.org/index.php?topic=10970.0
Semoga bermanfaat. Sumber http://farihinmuhamad.blogspot.com