hash - How to extract salt from sha512 digest? -


i encoded(sha512 hash)the password string "hello" using salt string "world" , saved string in file.

hex: 2b83319d3e78544e4430c4f5621968fee8b6ffa1254678b2c6fb98f7f79ff16afee2da909a7bb741488ca3bacbbf6cec8fd226c5a52eef805ea65a352e2ece8e  base64: k4mxnt54ve5emmt1yhlo/ui2/6elrniyxvuy9/ef8wr+4tqqmnu3quimo7rlv2zsj9imxauu74beplo1li7ojg==  

now in program have above encoded value of salted "hello" , fresh password string "hello". have again encode "hello" using same salt , compare output. possible extract salt above output?

you cannot retrieve "salt" hash. hash function one-way function cannot reversed (only brute-forced).

since you're using sha-512 , output 512-bit long (128 hex-encoded bytes), there no room salt stored. when create hashes using additional data such salt, need either store or use function produces string encodes such additional data output.

if you're hashing passwords or other brute-forceable data, use many iterations of such hash function, because 1 iteration not enough. common use pbkdf2, bcrypt or scrypt these use cases.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -