PBKDF2
classin packageklyn.cryptography
public class PBKDF2 extends SecretKeyFactory:
└ PBKDF2
PBKDF2 password-based key derivation parameterized by a concrete digest.
import klyn.cryptography

kdf = PBKDF2(SHA256())
spec = PBEKeySpec("password", "salty", 100000, 32)
print(kdf.generateSecret(spec))
Fields
Modifier and Type Member Description
public readonly hashAlgorithm
hashAlgorithm as String
Canonical digest algorithm name used by this PBKDF2 instance.
Attributes inherited from SecretKeyFactory: algorithm
Properties inherited from Object: type
Constructors
Modifier and Type Member Description
public PBKDF2 Creates a PBKDF2 instance using `SHA256`.
public PBKDF2
PBKDF2(hash as Object) throws CryptoException:
Creates a PBKDF2 instance bound to the given digest algorithm.
Methods
Modifier and Type Member Description
public generateSecret
generateSecret(spec as PBEKeySpec) as String throws CryptoException:
No summary.
public override generateSecret
generateSecret(spec as PBEKeySpec, outputEncoding as String) as String throws CryptoException:
No summary.
Methods inherited from SecretKeyFactory: generateSecret, getInstance, toString
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml