I see another problem: Your pascal implementation sets key badly. I think it should be 'key'[1]. However as I didn't even use buffer with constant string so I might be wrong. You should also try to encrypt longer messages to see if first block is intact because then it's padding problem. Please also note that such implementation is insecure because IV is static, key isn't derived with KDF, DES is insecure nowadays, and no integrity checking is done. So if you want your encryption to be of any security, fix these flaws. Also consider cleaning up code so we don't get confused about unused variables.

(Btw. My first post on this mailing list - yay!)

W dniu .11.2015 o 12:56 Gabriele Cappelletto <[email protected]> pisze:

But the cipther constructor does not refer to vector, but the variable IV. Vector is not used in this example

Il 15/11/2015 12:44, DougC ha scritto:
After quick look I noticed that

var
 Vector : array of Byte;

 SetLength(Vector, 8);
 Vector[0] := 1;
 Vector[1] := 2;
 Vector[2] := 3;
 Vector[3] := 4;
 Vector[4] := 5;
 Vector[5] := 6;
 Vector[6] := 7;
 Vector[7] := 8;

does not match

 Dim vector As String = "12345678"

Should be something like
 Vector[0] := '1';
 Vector[1] := '2';
 Vector[2] := '3';
 Vector[3] := '4';
 Vector[4] := '5';
 Vector[5] := '6';
 Vector[6] := '7';
 Vector[7] := '8';

I didn't look at the rest.



--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to