I understand the importance of salts, hashes and all that good stuff for passwords. My question relates to relational database theory.
My understanding of 3rd normal form is that every element must provide a fact about the key, the whole key, and nothing but the key (So help me Codd. Thanks Wikipedia). So I was reviewing some of my tables, and I came across this.
-- Users
CREATE TABLE accounts(
player_id mediumint NOT NULL AUTO_INCREMENT, -- Surrogate Key
username VARCHAR(32) UNIQUE NOT NULL, -- True primary key
salt char(29), -- Passwords are stored in bcrypt hash
hash char(60), -- Salt + Hash stored
created DATETIME,
lastlogin DATETIME,
PRIMARY KEY (player_id)
) ENGINE = InnoDB;
Question: is this table in 3rd normal form? My understanding is... the "Hash" is dependant on the player_id and the salt. IE: hash -> (username, salt).
I just can't see any real benefit to splitting up this table. But I'm worried that there's a possible update anomaly or something I can't see.