Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/SQL-based-authentication/00-TASK.txt
Normal file
16
Task/SQL-based-authentication/00-TASK.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
This task has three parts:
|
||||
* Connect to a [[MySQL]] database (<tt>connect_db</tt>)
|
||||
* Create user/password records in the following table (<tt>create_user</tt>)
|
||||
* Authenticate login requests against the table (<tt>authenticate_user</tt>)
|
||||
|
||||
This is the table definition:
|
||||
<syntaxhighlight lang="sql">create table users (
|
||||
userid int primary key auto_increment,
|
||||
username varchar(32) unique key not null,
|
||||
pass_salt tinyblob not null,
|
||||
-- a string of 16 random bytes
|
||||
pass_md5 tinyblob not null
|
||||
-- binary MD5 hash of pass_salt concatenated with the password
|
||||
);</syntaxhighlight>
|
||||
(<tt>pass_salt</tt> and <tt>pass_md5</tt> would be <tt>binary(16)</tt> values, but MySQL versions before 5.0.15 strip trailing spaces when selecting them.)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue