Saturday, 7 September 2013

Length of encrypted string using Blowfish in C

Length of encrypted string using Blowfish in C

I have a question. I don't know how to determine the length of encrypted
string once it is decrypted, especially since it is a needed parameter in
the blowfish function. For example,
BF_cfb64_encrypt(source, to, sizeof(source), &bf_key, iv, &enc,
BF_DECRYPT);
write(outFileDesc, newto, myStrlen(to));
printf("DECRYPTED TO %s", to);
I know the size of source, since it is the encrypted file which I parsed.
I don't know however know what the length of 'to' would end up being. It
could be less than 64, or more than 64. For all I know, that thousand page
encrypted file can just be a 'hello', how do I know what the thousand line
encrypted file's decrypted size is?
This is bothering me, any help, or an example would be of great
assistance. I was told in chunks might help, but that doesn't answer my
question. In particular, when I choose a large buffer, the outfile has the
original text(which I successfuly decrypted, but along with garbage like
#@##12@ which is from the extra not needed storage of the char array, I
want to determine a precise length.

No comments:

Post a Comment