Skip to content

Instantly share code, notes, and snippets.

@Arrlindii
Created September 20, 2018 11:41
Show Gist options
  • Save Arrlindii/59d1a9a992d6faeeb6bf962e9a9d1f55 to your computer and use it in GitHub Desktop.
Save Arrlindii/59d1a9a992d6faeeb6bf962e9a9d1f55 to your computer and use it in GitHub Desktop.
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