Also be aware that some mathematical routines work differently in php than Delphi - for example rounding numbers using Delphi is done according to "Bankers Rounding" rules (what we are used to), whereas in php rounding a number half way between two integers (eg 1.5, 2.5 etc) will round to the even number (1.5 becomes 2, as does 2.5).
May pay to just check simple parts of the encryption routine to confirm predicted output. Cheers, Phil. ----- Original Message ----- From: "Corey Murtagh" <[EMAIL PROTECTED]> To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]> Sent: Monday, May 31, 2004 4:35 PM Subject: Re: [DUG] Encryption > Wayne Roser wrote: > > > Hi > > I have a friend who wants to encript a string in php and decrypt using > > delphi. > > Apparently it didn't work so he tried encripting "Hello world" (of course) > > in php and delphi he gets different result strings using the "same" > > encryption algorithm. > > Any clues? > > Yep... his algorithm or key is probably different on both :> > > If he's using a PRNG to generate keys or encode data, have him test the > output of the PRNG to make sure both version generate the same numbers. > I ran foul of that with some bad assumptions between ECMAScript and > C++ (floating point precision). > > So... check key/key-stream, then check the implementation of the > algorithm to make sure the PHP and Delphi versions are identical (not > just 'close enough'). Run some more test strings through and examine > the outputs for similarities, and for tell-tales like one output being > smaller than the other. > > -- > Corey Murtagh > The Electric Monk > "Quidquid latine dictum sit, altum viditur!" > -- > Message scanned by the Sheriff > > > _______________________________________________ > Delphi mailing list > [EMAIL PROTECTED] > http://ns3.123.co.nz/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
