Created
July 13, 2019 09:28
-
-
Save aycanirican/1c313cf7b084fb250711aed5a28183be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// password based key derivation function 1 with SHA256 (PBKDF1SHA256) in golang | |
// strength 2^17 | |
func PBKDF1SHA256(pass []byte, salt []byte) []byte { | |
h := sha256.Sum256(append(pass, salt...)) // first_hash | |
for i := 0; i <= 1<<17; i++ { | |
h = sha256.Sum256(h[:]) | |
} | |
return h[:] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment