Storing binary data in mysql blob

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
scatty1985
Forum Newbie
Posts: 24
Joined: Fri Dec 18, 2009 8:57 am

Storing binary data in mysql blob

Post by scatty1985 »

Hi,

I've been reading kaisellgren blog on hashing and am trying to store some random binary data from /dev/urandom into the db. I read that mysql_real_escape_string() can be used to insert the data but read that it will get mallformed into the database?

How can I store the binary data so that it can be used to salt a password?
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: Storing binary data in mysql blob

Post by kaisellgren »

It's the other way around: if you don't escape, you will get your data corrupted at some point. So escaping here is not just about security.
Post Reply