Created
September 20, 2018 11:41
-
-
Save Arrlindii/59d1a9a992d6faeeb6bf962e9a9d1f55 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
func saveEncryptedPassword(_ password: String, for account: String) { | |
let salt = Array("salty".utf8) | |
let key = try! HKDF(password: Array(password.utf8), salt: salt, variant: .sha256).calculate().toHexString() | |
keychainService.save(key, for: account) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment