kaepora/miniLock — pull request #45 by diafygi (2014-07-23 00:14:08+00:00)
Title: Add salt to miniLock ID

Per discussion on #14, implemented the per-user salt as suggested by @ranok. This is intended to prevent a passive attacker from creating a universal hash table or rainbow table for common passphrases.

This is accomplished by generating a random salt (16 bytes) when the user first creates their miniLockID that is used to salt scrypt along with the user's passphrase. The secretKey is the result of this passphrase + salt + scrypt combination. Then, the publicKey derived from the secretKey is paired with the salt to create the miniLockID.

The user can recreate the secret key with only their passpharase and miniLockID (which contains the salt). This is easier than keeping a secretKey file since the miniLockID can be published widely.

NOTE: Since the salt is public, this does not prevent a targeted hash or rainbow table from being created. This is only to prevent a universal table from being created for all miniLockIDs.

NOTE: This initial implementation probably needs quite a bit of UI polish.

NOTE: The README.md has NOT been updated to explain the new methodology.

CC'ing @kaepora @zmanian