ďťż

Ładny brzuch

Czy ktoś wie jak przerobić ten kod:
type Bytes = array of Byte; function Encrypt(Buffer, Key, IV: Bytes): Bytes; var Encryptor: ICryptoTransform; ST: MemoryStream; Encrypt: CryptoStream; FAlgorythm: RijndaelManaged; begin if (IV = '') or (Key = '') then begin Result := Buffer; Exit; end; FAlgorythm := RijndaelManaged.Create; FAlgorythm.IV := IV; FAlgorythm.Key := Key; FAlgorythm.Mode := CipherMode.CBC; FAlgorythm.Padding := PaddingMode.Zeros; Encryptor := FAlgorythm.CreateEncryptor; ST := MemoryStream.Create; Encrypt := CryptoStream.Create(ST, Encryptor, CryptoStreamMode.Write); Encrypt.Write(Buffer, 0, Length(Buffer)); Encrypt.FlushFinalBlock; Result := ST.ToArray; end; function Decrypt(Buffer, Key, IV: Bytes): Bytes; var Decryptor: ICryptoTransform; ST: MemoryStream; Decrypt: CryptoStream; FAlgorythm: RijndaelManaged; begin if (IV = '') or (Key = '') then begin Result := Buffer; Exit; end; FAlgorythm := RijndaelManaged.Create; FAlgorythm.IV := IV; FAlgorythm.Key := Key; FAlgorythm.Mode := CipherMode.CBC; FAlgorythm.Padding := PaddingMode.Zeros; Decryptor := FAlgorythm.CreateDecryptor; ST := MemoryStream.Create(Buffer); Decrypt := CryptoStream.Create(ST, Decryptor, CryptoStreamMode.Read); SetLength(Result, ST.Length); Decrypt.Read(Result, 0, ST.Length); end;

tak żeby kodował i rozkodowywał tekst w stringu?? (.net)
Lub jak przerobić TO!!! z C# do delphi.NET



Wie ktoś co z tym zrobić?? Zależy mi na szybkości ;)

zamień text (klucz i text do zakodowania) na tablicę kodów ASCI i już, np klucz 'ala" będzie wyglądał (97, 108, 97)

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • zsf.htw.pl
  •