in reply to Re: Is this a secure way to prevent cookie tampering
in thread Is this a secure way to prevent cookie tampering

1. Encrypt it.
2. bin2hex/urlencode/uuencode it.
3. take the md5 and append it.
Take the md5 of what? If you md5 the ciphertext, an attacker can still flip bits as I described elsewhere in this thread, then recompute the md5. If you md5 the plaintext, that may allow him to launch a dictionary attack. For best results, use a real keyed MAC function.

And I thought everybody knew better than to use md5 for new development by now.

  • Comment on Re^2: Is this a secure way to prevent cookie tampering

Replies are listed 'Best First'.
Re^3: Is this a secure way to prevent cookie tampering
by exussum0 (Vicar) on Jun 30, 2004 at 16:48 UTC
    md5 the plain text and then encrypt that. if you are worried about plaintext attacks, gzip the plain text to turn it to binary first.

    TIMTOWTDI.

    Bart: God, Schmod. I want my monkey-man.

      TIMTOWTDI
      Yes, there is more than one way. Many of the ways are booby trapped, though. It's best to be somewhat less offhand about proposing new cryptographic protocols.

      if you are worried about plaintext attacks, gzip the plain text to turn it to binary first.
      Binary data is still plaintext to a cryptographer. Gzipping can reduce some redundancies in the plaintext, but it also introduces its own structure.
        If you dont' obfuscate your original data, either by zipping, xoring, bitshiffting or what-have you before hand, regardless if you use a MAC or you use encryption without MAC, you still have the possibility of plaintext attacks.

        Bart: God, Schmod. I want my monkey-man.