PBKDF
open class PBKDF
Derives key material from a password or passphrase.
-
Enumerates available pseudo random algorithms
See moreDeclaration
Swift
public enum PseudoRandomAlgorithm
-
Determines the (approximate) number of iterations of the key derivation algorithm that need to be run to achieve a particular delay (or calculation time).
Declaration
Swift
open class func calibrate(passwordLength: Int, saltLength: Int, algorithm: PseudoRandomAlgorithm, derivedKeyLength: Int, msec : UInt32) -> UInt
Parameters
passwordLength
password length in bytes
saltLength
salt length in bytes
algorithm
the PseudoRandomAlgorithm to use
derivedKeyLength
the desired key length
msec
the desired calculation time
Return Value
the number of times the algorithm should be run
-
Derives key material from a password and salt.
-parameter password: the password string, will be converted using UTF8 -parameter salt: the salt string will be converted using UTF8 -parameter prf: the pseudo random function -parameter round: the number of rounds -parameter derivedKeyLength: the length of the desired derived key, in bytes. -returns: the derived key
Declaration
Swift
open class func deriveKey(password: String, salt: String, prf: PseudoRandomAlgorithm, rounds: uint, derivedKeyLength: UInt) -> [UInt8]
-
Derives key material from a password and salt.
-parameter password: the password string, will be converted using UTF8 -parameter salt: the salt array of bytes -parameter prf: the pseudo random function -parameter round: the number of rounds -parameter derivedKeyLength: the length of the desired derived key, in bytes. -returns: the derived key
Declaration
Swift
open class func deriveKey(password: String, salt: [UInt8], prf: PseudoRandomAlgorithm, rounds: uint, derivedKeyLength: UInt) -> [UInt8]
-
Derives key material from a password buffer.
- return: the number of times the algorithm should be run
Declaration
Swift
open class func deriveKey(password: UnsafePointer<Int8>, passwordLen: Int, salt: UnsafePointer<UInt8>, saltLen: Int, prf: PseudoRandomAlgorithm, rounds: uint, derivedKey: UnsafeMutablePointer<UInt8>, derivedKeyLen: Int)
Parameters
password
pointer to the password buffer
passwordLength
password length in bytes
salt
pointer to the salt buffer
saltLength
salt length in bytes
prf
the PseudoRandomAlgorithm to use
rounds
the number of rounds of the algorithm to use
derivedKey
pointer to the derived key buffer.
derivedKeyLength
the desired key length