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

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.

Replies are listed 'Best First'.
Re^8: Decrypting BlowfishNET (try2)
by Anonymous Monk on Aug 20, 2009 at 17:32 UTC
    One problem that you may have is that the NET function ConvertFromBase64 does not give the same result as perl MIME::Base64. The results look very similar but doing a hex dump of the perl and the NET versions shows that they are different. My ramblings on this subject are below. Don't treat it as character data ??? A true Base64 encoding function would be: Create a byte array which is of an appropriate size, then populate it by taking each pair of characters in turn and using Byte.Parse with the number style of HexNumber. http://bytes.com/topic/c-sharp/answers/234105-base64-encode-characters-127-a Base64 encoding turns 3 bytes into 4? http://bytes.com/topic/c-sharp/answers/224907-base64-string-byte-array-whats-length-ratio