Files
kdf.kt/README.md
Infendro f78b10f565
Some checks failed
/ publish (pull_request) Has been cancelled
/ test (pull_request) Has been cancelled
/ publish (push) Has been cancelled
/ test (push) Has been cancelled
upgrade
2026-02-03 23:42:46 +01:00

36 lines
788 B
Markdown

# kdf-kt
`kdf-kt` is a Kotlin Multiplatform library that provides common [Key Derivation Functions](https://en.wikipedia.org/wiki/Key_derivation_function).
Supported algorithms:
- PBKDF2
## Installation
Add the following to your `build.gradle.kts`.
```kotlin
repositories {
maven("https://git.infendro.com/api/packages/Infendro/maven")
}
dependencies {
implementation("com.infendro:kdf:1.2.0")
}
```
## Usage
```kotlin
fun main() {
// create a PBKDF2 instance using HMAC SHA-256
// 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()
val salt = "salt".encodeToByteArray()
val hash = kdf.hash(value, salt)
}
```