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, GetSysDir+'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;