Skip to content

KotlinCrypto/core

Repository files navigation

core

badge-license badge-latest-release

badge-kotlin badge-error

badge-platform-android badge-platform-jvm badge-platform-js badge-platform-js-node badge-platform-wasm badge-platform-linux badge-platform-macos badge-platform-ios badge-platform-tvos badge-platform-watchos badge-platform-windows badge-support-android-native badge-support-apple-silicon badge-support-js-ir badge-support-linux-arm

Low level core cryptographic components for Kotlin Multiplatform

NOTE: For Jvm, Digest extends java.security.MessageDigest and Mac extends javax.crypto.Mac for interoperability.

Modules

API Docs

Library Authors

Modules in core are intentionally single purpose and small such that you are able to include them in your APIs without having to import some massive crypto library. Consumers of your APIs can then import the higher level implementations to use with your library (giving them the choice of what algorithms they wish to use, importing only what they need).

This also means that as new higher level functions get implemented, you do not need to do anything.

/**
 * This feature of Foo requires a dependency if you wish to use it.
 * See: https://github.com/KotlinCrypto/hash
 * */
class FooFeatureA(digest: Digest) {
    // ...
}

Get Started

The best way to keep KotlinCrypto dependencies up to date is by using the version-catalog. Alternatively, see below.

// build.gradle.kts
dependencies {
    val core = "0.6.0"
    implementation("org.kotlincrypto.core:digest:$core")
    implementation("org.kotlincrypto.core:mac:$core")
    implementation("org.kotlincrypto.core:xof:$core")
}