Blowfish and data intergity...

delphi package - easy access to security apis

Blowfish and data intergity...

Postby Mark- » Fri Dec 06, 2019 5:38 am

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
Mark-
 
Posts: 15
Joined: Sat May 24, 2014 4:51 pm

Re: Blowfish and data intergity...

Postby madshi » Fri Dec 06, 2019 10:36 am

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.
madshi
Site Admin
 
Posts: 10121
Joined: Sun Mar 21, 2004 5:25 pm

Re: Blowfish and data intergity...

Postby Mark- » Fri Dec 06, 2019 1:57 pm

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.
Mark-
 
Posts: 15
Joined: Sat May 24, 2014 4:51 pm


Return to madSecurity

Who is online

Users browsing this forum: No registered users and 1 guest

cron