a1372073105971d22dbecec9028b085b7c0f8bc7
Kotlin MAC
This library provides various Message Authentication Code implementations in Kotlin Multiplatform.
Features
- Generate message authentication codes.
- Multiplatform support
- JVM
- JavaScript
- Native (Linux)
Installation
Add the following to your build.gradle.kts.
repositories {
maven("https://git.infendro.com/api/packages/Infendro/maven")
}
dependencies {
implementation("com.infendro:mac:1.2.2")
}
Usage
import com.infendro.hash.SHA1
import com.infendro.mac.HMAC
fun main() {
// create an HMAC instance using SHA1
val hmac = HMAC(SHA1)
// generate MAC
val key = "secret".encodeToByteArray()
val value = "Hello World!".encodeToByteArray()
val mac = hmac.hash(key, value)
}
Description
Languages
Kotlin
100%