hash("This is an arbitrary string") => aad348cc30efef7876a61e6214536f82bc3bd68d
| Username | Password |
|---|---|
| Bob | password123 |
| Username | Password |
|---|---|
| Bob | cbfdac6008f9cab4083784cbd1874f76618d2a97 |
| Username | Password |
|---|---|
| Bob | cbfdac6008f9cab4083784cbd1874f76618d2a97 |
| Alice | cbfdac6008f9cab4083784cbd1874f76618d2a97 |
| Joe | 96d712a79f47055aebcfed0a58092ef7d12da37f |
| Username | Password | Salt |
|---|---|---|
| Bob | 40d04338e807.... | ThisIsASalt |
function encrypt(message, key)
function decrypt(message, key)
*: Actually, it only proves the originator has a particular secret key.
There are two parts to a signed message.
Anyone with the associated public key can decrypt the encrypted hash and validate that it's correct by hashing the message and seeing if it matches.
hash("password123"+"ThisIsASalt") === 40d04338e807726c5715f92a3e7ea8076a55c17a