Blowfish and data intergity...

delphi package - easy access to security apis
Post Reply
Mark-
Posts: 20
Joined: Sat May 24, 2014 4:51 pm

Blowfish and data intergity...

Post by Mark- »

Hello,

It is late and I might not have my thinking cap snug.
Using the Encrypt/Decrypt on some strings. I encrypt data, save it to a file or send across some network.
The encrypted data becomes corrupted.
The password is the same on both ends and Decrypt just applies the password to the data.
The resulting buff is garbage or at least some of it.
So looking for a way to verify data integrity after Decrypt is executed.
I thought to store a fixed value at the beginning and end.
Then check if correct after Decrypt.
So I guess the question: If any part of the data becomes corrupted after Decrypt will every byte in the buffer be hosed or just some? Or who knows, depends on what part is corrupted.

Perhaps data integrity is outside the scope of blowfish.

Ideas?

Thanks,

Mark
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Blowfish and data intergity...

Post by madshi »

I'd suggest to simply prepend or append a simple CRC or hash. The key thing is if the CRC/hash matches the data. If any bit is damaged (in the data itself, or in the CRC/hash), it will not match. It should only match if the data is 100% clean.
Mark-
Posts: 20
Joined: Sat May 24, 2014 4:51 pm

Re: Blowfish and data intergity...

Post by Mark- »

Yeah I thought the same. Then I wavered. HA
My main concern was when the data was saved to a file, someone tampered with the file.
I think I will add a CRC.

Thanks for your help and the mad suite.
Post Reply