Re: mcrypt_encrypt giving different results for same input?



Mtr wrote:
On Tue, 02 Oct 2007 06:58:58 -0400, Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
wrote:

Mtr wrote:
On Mon, 01 Oct 2007 23:20:14 -0400, Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
wrote:

laredotornado@xxxxxxxxxxx wrote:
on one call I get the encrypted string, "ë;jéøÕG·" and on the other
call, I get "ø34Avýä". What gives?

Thanks, - Dave

I hate to state the obvious, but obviously there is something different between the two. mcrypt_encrypt gives the same output for the same input.

Look for differences in capitalization, '1' (one) instead of 'l' (lower case ell) or 'I' (upper case eye), for instance. It's very easy to do.
well, not necesarily. Maybe it's a chain cypher - and he's not
re-initializing.

Although his code sample does say ECB, I don't know what the parameters
mean for this extension function anyway.

(top posting fixed)

Your posting makes no sense whatsoever. Did you actually try the code?

no, that's why I deliberately used the word "maybe" in my suggestion. No
one else had replied, so I offered a possible suggestion.


So, rather than just leave it be, you made a completely irrelevant comment. Do you just like seeing your name on usenet?

If it were a chain cipher, you would have to follow the same chain to decrypt.

He never mentioned decryption in his post, only the diffrent results of
encryption.


Gee, encryption isn't much good if you can't decrypt it, is it now?

And before you go off on one-way encryption schemes - those are not encryption methods. They are hashing methods. Encryption by definition is two way.

And a quick test of the code would have shown you this is not a chain cipher.

no, now you're the one who is making no sense. Whether or not it is chained
is internal to the cipher, not to the code that calls it. The difference
would also be apparent (via knowledge of the parameters) if I were a user
of that crypto extension, which I'm not. That's why I also deliberately
said that I don't know what the parameters mean. But the use of ECB does
tend to say it's not chained - which I also deliberately mentioned.


And as I said. Had you tested it, you would have found out it is not a chained cipher.

Remember the old saying. "It is better to be thought an idiot than to open your mouth and remove all doubt."

Also, please don't top post. Thanks.

do you know that some people get irritated over interleaved replies, too?

No, as I said earlier. This group uses bottom posting or interleaved posting. Both are acceptable.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: My Ciphers Completed Entirely Here in Sci Crypt - Collected Results.
    ... Examples from Singh and the 'code book' start from the very first page with the cipher from Mary Queen of Scots. ... And he had messages being generated to report being shelled, nothing to report, if a unit was gassed and on. ... Notice that from WW1 onwards the enemy had *COMPLETE* knowledge of the encryption method detailed enough that they could make there own compatible systems - read about the WW2 British Typex machine which had the ability to load an electrically equivalent rotors of the enimga and it was actually used to decrypt German messages. ... Since about half the ASCII letters are non-printing a message longer than 30 letters is very unlikely to have a valid decryption with a wrong key. ...
    (sci.crypt)
  • Re: An Honest and Simple Question.
    ... encryption is for the printable subset of ASCII only. ...  Somehow the user, or email client program, has to figure out ... obsessively single-minded about) and even more so the RSA cipher. ... It matters not that the mathematics is asymmetric or symmetric - its ...
    (sci.crypt)
  • Re: An Honest and Simple Question.
    ... of a theoretically unbreakable mathematical algorithm, ... encryption is for the printable subset of ASCII only. ...  Somehow the user, or email client program, has to figure out ... obsessively single-minded about) and even more so the RSA cipher. ...
    (sci.crypt)
  • Re: An Honest and Simple Question.
    ... of a theoretically unbreakable mathematical algorithm, ... encryption is for the printable subset of ASCII only. ... Somehow the user, or email client program, has to figure out ... obsessively single-minded about) and even more so the RSA cipher. ...
    (sci.crypt)
  • Re: Should Initialization Vectors be public ?
    ... CBC XORes every previous cipher block with next plain text block before ... encryption key on the same plain text, ... add them at the beginning of your plaintext data ...
    (microsoft.public.dotnet.security)