cryptography-kotlin
A cryptography library for Kotlin Multiplatform, which wraps well-known future-proof platform-native solutions like
OpenSSL,
CryptoKit,
WebCrypto or
JCA
with a type-safe uniform API, aligned defaults as well as tested for cross-compatibility between platforms.
Quick start
Add dependencies:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("dev.whyoleg.cryptography:cryptography-core:0.6.0")
implementation("dev.whyoleg.cryptography:cryptography-provider-optimal:0.6.0")
}
}
}
Use the library:
val sha = CryptographyProvider.Default.get(SHA512).hasher()
sha.hash("Kotlin is Awesome".encodeToByteArray())
For more, see the Getting Started guide
and API Reference.
Supported algorithms
Detailed documentation is available on the project website,
including the full provider support matrix.