Hi Daniweb,

I have a question for you guys. I've been reading up on PHP security and want to get it down pat before embarking on some projects I wish to do. The question right now is about how to create a table with PHP that will enable SHA1 hashing without requiring me to log in to phpMyAdmin and select it from the drop down. Basically, what I'm asking is can the SHA1 be written as part of a PHP table creation script?

Here's what I've tried.

$sql = "CREATE TABLE Members
(
   mem_id int(3) NOT NULL AUTO_INCREMENT,
   mem_username varchar(12) NOT NULL UNIQUE,
   mem_password [B][U][I]md5(varchar(12))[/I][/U][/B] 
)

Hi Daniweb,

I've found my solution. You can't do something which I was trying to do -- use a hash when creating the table -- and the way to apply hashes to user passwords is done in the "INSERT" process.

Here's a link explaining how md5, sha, and sha1 hashing is used.

Thanks!

lol

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.