1. Navigation
  2. Content

» Handling TripleDES (ECB with PKCS5Padding) in PHP | Chris Mckee Designs, by Chris McKee, who'd of guessed | ChrisMcKee.co.uk


9 Responses to “ Handling TripleDES (ECB with PKCS5Padding) in PHP ”

  1. This example doesn't work for me. It doesn't show anything in the test portion that echo's out the decrypt results

    You are using Php5 right?

  2. Nevermind, it works just not in the Grails PHP plugin...

  3. Thanks, BTW! Great post!

  4. No probs, glad you worked it out. I was using a fedora based system with php 5.0 when this was written, but have since tested it on a debian and freebsd system running 5.3.

  5. Great!

    Thanks for publishing this. That's exactly what I was looking for!

    Your pkcs5_pad() function did it. Fantastic job.

    Cheers

    Renato

  6. How about CBC mode ? I tried this for CBC mode (I replaced 'ecb' with 'cbc' for mcrypt mode) but it does not work. The first part of decrypted string (first 8 chars) is wrong. Do you have any ideas ? Thanks.

  7. Are you using PKCS5Padding with that?
    If not you can just use ... http://php.net/manual/en/function.mcrypt-cbc.php

  8. Yes, I need PKCS5Padding too :)

  9. Yes, I have to use PKCS5Padding too. The first 8 chars are something like this 'D ���.53'. Thanks for the reply.