OkonomiDev
Monday, November 25, 2002
      ( 11:18 AM ) Matt  

passwd


Something else that should be stored in a database are password-key-username combinations. These effectively make up something equivalent to a UNIX passwd file. Like a typical passwd file, there are entries allowing a user to securely log in without compromising the password. As typical in UNIX systems, Okonominet will accomplish this by 'salting' and 'hashing'.


Before I get further into the details, let me show you what an okonominet passwd entry looks like:

[username] [uid] [salt] [password-hash] [public-key] [signature]


Here are some definitions:


[username] - identifier chose by the user. (e.g. joeuser)

[public-key], [private-key] - a key pair generated randomly used for secure transactions.

[uid] = HASH(SALT([username], [public-key]))

[signature] = ([username] [uid] [salt] [password-hash] [public-key])^[private-key]

[password-hash] = HASH(SALT([password], [salt]))

[password] - user chosen password.

[salt] - some randomly generated bits.

And here are definitions of the functions I used above.

Encryption and decryption: [text]^[public-key] - encryption of [text] using the key [public-key]. If [public-key] and [private-key] form a key pair (as above) then these equalities hold true:

  • ([text]^[public-key])^[private-key] = [text] - a message encrypted with the public key can be decrypted with the private key.

  • ([text]^[private-key])^[public-key] = [text] - a message encrypted with the private key can be decrypted with the public key.

There is no effective way of determining the text or private key given [public-key] and [text]^[public-key]. Similarly, there is no reasonable way of determining the value of the private or public key given [text] and [text]^[public-key] and [text]^[private-key]. These properties make the encryption scheme strong.

HASH(x) a one way function with these properties:

  • HASH(x) = HASH(y) only when x = y. (Except for some vary rare cases which are not predictable.)

  • Given HASH(x) there is no reasonable way of determining the value of x.


SALT(x,y) some way of combining x and y such that a changing the value of x or y will result in a change in the value of the function. An exclusive or function achieves this.


I think this scheme makes it pretty hard to forge a line in a password file, compromise someone's key pair, or otherwise do something which compromises the authentication or security of okonominet even when the password file can be both read and augmented by the entire community.


I left a lot of details out, (for example, the length of all these various items) but I hope this makes sense. Let me know what you think.


# -




Comments: Post a Comment
archives:


Dreams I have...

Powered by Blogger
Feel free to e-mail me.

free hit counter