Monday 15 March 2010

delphi - How to hash using DCPcrypt? -


I have betrayed the net in an attempt to find an example of a function, how hash text with Sha1 and DCPcrypt.

I have to help Korting the following examples seem to pop up all the time but it offers Chinese characters function.

  function TForm1.EncryptThis (aString: string): string; Var Cipher: TDCP_Cast 256; KeyStr: string; Start KeyStr: = ''; Cipher: = TDCP_Cast 256. Create (self); Cipher.InitStr (KeyStr, TDCP_sha1); Results: = Cipher Encryption string (estring); Cipher.Burn; Cipher.Free; End;  

Update: by using the link below and information, I have made these functions. But as I said, it does not make me very understandable. So forgive the ignorance

This code does not work though. Is produced: 3F3F3F3F3F3F3F3F3F3F00000000000000000000 while 40bd001563085fc35165329ea1ff5c5ecbdbbeef since I have for this program 123

Please help Should be told ..

Function calculator (text: string): string; Var x: TDCP_hash; Start x: = TDCP_sha1. Composition (zero); Try x.Init; X.UpdateStr (text); SetLength (result, x.GetHashSize div 8); X.Final (result [1]); Finally X. free; End; End; Function string 2 hex (constant buffer: nesting): string; Start SetLength (result, 2 * length (buffer)); Binteheks (@ buffer [1], Peedbluiidiyr (@ Roots [1]), length (buffer)); End; Process TForm1.Button1Click (Sender: Tubbed); Var I: integer; Starting memo2.Lines.Add (String2Hex (CalcDigest (memo1.Lines.Strings [0]))); End; After testing from "text" itemprop = "text">

after

No comments:

Post a Comment