CREATE TABLE secure_fields ( id INTEGER UNSIGNED PRIMARY KEY AUTO_INCREMENT NOT NULL, salt INTEGER UNSIGNED NOT NULL, passwd CHAR(40) NOT NULL ); #### plaintex_passwd = The plaintext password from the user hex() = Hex encoding function SHA1() = SHA1 digest function salt = Random 32-bit value (doesn't need to be a cryptographically secure random num) + = String concat hex( SHA1( salt + SHA1( salt + plaintext_passwd ) ) )