Files
kdf.kt/README.md
Infendro 8644c79167 update README
small rewording, link wikipedia article
2025-12-14 14:30:18 +01:00

1.1 KiB

kdf-kt

kdf-kt is a Kotlin Multiplatform library that provides common Key Derivation Functions.

Supported algorithms:

  • PBKDF2

Targets

Target Status
JVM Supported
JavaScript Supported
Native (Linux) Supported
Native (Windows) Not Supported

Installation

Add the following to your build.gradle.kts.

repositories {
    maven("https://git.infendro.com/api/packages/Infendro/maven")
}

dependencies {
    implementation("com.infendro:kdf:1.1.0")
}

Usage

import com.infendro.hash.`SHA-256`
import com.infendro.kdf.PBKDF2

fun main() {
    // create a PBKDF2 instance using HMAC SHA256
    //   this example uses 32 bytes of length and 100_000 iterations
    val kdf = PBKDF2(32, 100_000, `SHA-256`)

    // securely hash value with some salt
    val value = "password".encodeToByteArray().asUByteArray()
    val salt = "salt".encodeToByteArray().asUByteArray()
    val hash = kdf.hash(value, salt)
}