Procedure tform3.formcreate (Sender: tobject );
VaR
Regi: string;
F: textfile;
Cipher: tdcp_blockcipher;
S: string;
Begin
Assignfile (F, getsysdir0000'test.txt ');
Reset (f );
Readln (F, S );
Closefile (f );
Cipher: = tdcp_blockcipher (dcp_cast2561 );
Cipher. initstr ('key ');
S: = b64decode (s );
Cipher. decryptcfb (s [1], s [1], length (s ));
Cipher. Reset;
Cipher. Burn;
Showmessage (s );
End;
Procedure tform3.cxbutton2click (Sender: tobject );
VaR
Regi: string;
F: textfile;
Cipher: tdcp_blockcipher;
S: string;
Begin
Regi: = 'this is a book .';
Cipher: = tdcp_blockcipher (dcp_cast2561 );
Cipher. initstr ('key ');
Cipher. encryptcfb (REGI [1], Regi [1], length (REGI ));
S: = b64encode (REGI );
Cipher. Reset;
Cipher. Burn;
Assignfile (F, getsysdir0000'test.txt ');
Rewrite (f );
Writeln (F, S );
Closefile (f );
End;
Dcpcrypt1.31
Function tform3.enc (S: string): string;
Begin
Dcp_cast2561.initstr ('hzq-1982.1983 ');
Dcp_cast2561.encryptcfb (s [1], s [1], length (s ));
S: = b64encode (s );
Dcp_cast2561.reset;
Dcp_cast2561.burn;
Result: = s;
End;
Function tform3.dec (S: string): string;
Begin
Dcp_cast2561.initstr ('hzq-1982.1983 ');
S: = b64decode (s );
Dcp_cast2561.decryptcfb (s [1], s [1], length (s ));
Dcp_cast2561.reset;
Dcp_cast2561.burn;
Result: = s;
End;