whyoleg/cryptography-kotlin

A cryptography/crypto library for Kotlin Multiplatform

Kotlin

664

942 commits

updated Sep 30, 2026

See the code

README

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:

// get a hasher
val sha = CryptographyProvider.Default.get(SHA512).hasher()
// hash a message
sha.hash("Kotlin is Awesome".encodeToByteArray())

For more, see the Getting Started guide and API Reference.

Supported algorithms

OperationAlgorithms
HashingSHA224, SHA256, SHA384, SHA512, SHA3, SHA1, MD5, RIPEMD160
MACAES-CMAC, HMAC
Digital SignaturesRSA-PSS, RSA-PKCS1, ECDSA, EdDSA, DSA
AEADAES-GCM, AES-CCM, ChaCha20-Poly1305
Symmetric EncryptionAES-CBC, AES-CTR, AES-ECB, AES-OFB, AES-CFB, AES-CFB8
Public-Key EncryptionRSA-OAEP, RSA-PKCS1, RSA-RAW
Key AgreementECDH, XDH, DH
Key DerivationPBKDF2, HKDF

Detailed documentation is available on the project website, including the full provider support matrix.

aes
crypto
cryptography
ecdsa
encryption
kmp
kotlin
kotlin-multiplatform
multiplatform
rsa
signature

Significant stargazers

Luke Warlow

162 followers · starred Jul 2025

Jesse Wilson

6,521 followers · starred Mar 2023

Paul Merlin

223 followers · starred Oct 2024

Filipp Zhinkin

42 followers · starred Mar 2024

whyoleg/cryptography-kotlin

A cryptography/crypto library for Kotlin Multiplatform

Kotlin

664

942 commits

updated Sep 30, 2026

See the code

README

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:

// get a hasher
val sha = CryptographyProvider.Default.get(SHA512).hasher()
// hash a message
sha.hash("Kotlin is Awesome".encodeToByteArray())

For more, see the Getting Started guide and API Reference.

Supported algorithms

OperationAlgorithms
HashingSHA224, SHA256, SHA384, SHA512, SHA3, SHA1, MD5, RIPEMD160
MACAES-CMAC, HMAC
Digital SignaturesRSA-PSS, RSA-PKCS1, ECDSA, EdDSA, DSA
AEADAES-GCM, AES-CCM, ChaCha20-Poly1305
Symmetric EncryptionAES-CBC, AES-CTR, AES-ECB, AES-OFB, AES-CFB, AES-CFB8
Public-Key EncryptionRSA-OAEP, RSA-PKCS1, RSA-RAW
Key AgreementECDH, XDH, DH
Key DerivationPBKDF2, HKDF

Detailed documentation is available on the project website, including the full provider support matrix.

aes
crypto
cryptography
ecdsa
encryption
kmp
kotlin
kotlin-multiplatform
multiplatform
rsa
signature

Significant stargazers

Luke Warlow

162 followers · starred Jul 2025

Jesse Wilson

6,521 followers · starred Mar 2023

Paul Merlin

223 followers · starred Oct 2024

Filipp Zhinkin

42 followers · starred Mar 2024

Languages

Kotlin

97.8%

Swift

1.9%