pbkdf2 sha512 password hash size

835 Views Asked by At

I'm a total newbie to flask let alone cryptography. I'm currently following Miguel Grinberg's flask tutorial. I'm trying to store a pbkdf2:sha512 hashed password with salt length 64 but I can't find the appropriate length to store it in the Database is it db.string(128) or 512.

1

There are 1 best solutions below

0
On

Refer following pbkdf2-sha512 digest,

$pbkdf2-sha512$10001$0dr7v7eWUmptrfW.9z6HkA$w9j9AMVmKAP17OosCqDxDv2hjsvzlLpF8Rra8I7p/b5746rghZ8WrgEjDpvXG5hLz1UeNLzgFa81Drbx2b7.hg

OR

$pbkdf2.sha512.10000.4483972AD2C52E1F590B3E2260795FDA9CA0B07B96FF492814CA9775F08C4B59CD1707F10B269E09B61B1E2D11729BCA8D62B7827B25B093EC58C4C1EAC23137.DF4FCB5DD91340D6D31E33423E4210AD47C7A4DF9FA16F401663BF288C20BF973530866178FE6D134256E4DBEFBD984B652332EED3ACAED834FEA7B73CAE851D

which is ideally less than 256 character. But sometimes it will go above 256 characters also. So you should use db.string(512).