in reply to Re^3: Decrypting BlowfishNET (try2)
in thread line by line Encryption fun with Crypt::CBC and Rijndael? File Ownership issues?

Thank you for your help. I don't think there is a byte-ordering problem here. You are right about the padding, I am unsure as to how BlowfishSimple does it. I have tried a few things and am just not sure how I should proceed. Do you have any suggestions on what I could try?

Thanks again.

Replies are listed 'Best First'.
Re^5: Decrypting BlowfishNET (try2)
by ikegami (Patriarch) on Aug 11, 2008 at 19:22 UTC

    You are right about the padding, I am unsure as to how BlowfishSimple does it.

    It doesn't y. You do it in the Encrypt function you presented.

    I have tried a few things and am just not sure how I should proceed.

    Comparing the libraries and see where they differ.

      You are right about the padding, I am unsure as to how BlowfishSimple does it.

      It doesn't you do it in the Encrypt function you presented.

      The encrypt subroutine I pasted above was from from the BlowfishSimple class. It comes as part of the BlowfishNET download. I was comparing the libraries to see how the two encrypt and decrypt and I believe they pad differently. That is the reason I pasted the subroutine here. I thought I had mentioned it.

      As far using the BlowfishSimple library/class, it pretty much boils down to making the following calls:

      bfs = new BlowfishSimple(key); enc = bfs.Encrypt(plaintext);

      So, as you can see that is why I keep querying about how the padding is done in BlowfishSimple, because that is what I thought is different, but then, I am not sure.

      Thank you for your help.

        BlowfishSimple:
        $fill = $unpadded_len % $block_size;

        Crypt::CBC (by default):
        $fill = $pad_size;

        size of padding
        01234567
        padded withBlowfishSimple76543210(For cyphers with a blocksize of 8)
        Crypt::CBC01234567

        Update: I accidentally had the note about blocksize dependence attached to Crypt::CBC. Fixed.