cryptography-kotlin

Type-safe cryptography library offering secure random generation, common cryptographic operations (ciphers, digests, signatures), and multiple algorithm supports (AES, RSA, ECDSA, SHA) with various providers like OpenSSL and WebCrypto.

JVMKotlin/NativeWasmJS
GitHub stars549
Authorswhyoleg
Open issues23
LicenseApache License 2.0
Creation datealmost 4 years ago

Last activity4 days ago
Latest release0.5.0 (9 months ago)

cryptography-kotlin

Type-safe Multiplatform cryptography library for Kotlin

CryptographyProvider.Default
    .get(SHA512)
    .hasher()
    .hash("Kotlin is Awesome".encodeToByteArray())

Detailed documentation can be found on project website

Overview

cryptography-kotlin provides multiplatform API which consists of multiple components:

The library doesn't implement any cryptography algorithm on its own, but wraps well-known future-proof solutions like OpenSSL 3.x, CryptoKit, WebCrypto or JCA with type-safe multiplatform API providing uniform experience with aligned default behavior, and same expected results using identical parameters while allowing to use platform-specific capabilities. For supported algorithms, primitives and targets, please consult Providers documentation

Using in your projects

Make sure that you use Kotlin 2.2.0+. Using an earlier Kotlin version could still work, but not tested. The library is published to Maven Central, so make sure that it’s added to repositories.

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("dev.whyoleg.cryptography:cryptography-core:0.5.0")
            implementation("dev.whyoleg.cryptography:cryptography-provider-optimal:0.5.0")
        }
    }
}

Additionally, it's possible to use BOM or Gradle version catalog to add dependencies easier.

JVMKotlin/NativeWasmJS
GitHub stars549
Authorswhyoleg
Open issues23
LicenseApache License 2.0
Creation datealmost 4 years ago

Last activity4 days ago
Latest release0.5.0 (9 months ago)

cryptography-kotlin

Type-safe Multiplatform cryptography library for Kotlin

CryptographyProvider.Default
    .get(SHA512)
    .hasher()
    .hash("Kotlin is Awesome".encodeToByteArray())

Detailed documentation can be found on project website

Overview

cryptography-kotlin provides multiplatform API which consists of multiple components:

The library doesn't implement any cryptography algorithm on its own, but wraps well-known future-proof solutions like OpenSSL 3.x, CryptoKit, WebCrypto or JCA with type-safe multiplatform API providing uniform experience with aligned default behavior, and same expected results using identical parameters while allowing to use platform-specific capabilities. For supported algorithms, primitives and targets, please consult Providers documentation

Using in your projects

Make sure that you use Kotlin 2.2.0+. Using an earlier Kotlin version could still work, but not tested. The library is published to Maven Central, so make sure that it’s added to repositories.

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("dev.whyoleg.cryptography:cryptography-core:0.5.0")
            implementation("dev.whyoleg.cryptography:cryptography-provider-optimal:0.5.0")
        }
    }
}

Additionally, it's possible to use BOM or Gradle version catalog to add dependencies easier.