Module cryptography-core¶
Provides multiplatform API to build, get and use cryptography primitives
Core entities:
- CryptographyProvider provides a way to get specific CryptographyAlgorithm by its id
- CryptographyProvider.Default is the default provider which is just a link to the first registered provider. After adding dependency to provider (like openssl3) it will be automatically registered as default
- inheritors of CryptographyAlgorithm (like f.e. AES) provides access to operations (like f.e. cipher)
Example¶
CryptographyProvider.Default
.get(SHA512)
.hasher()
.hash("Kotlin is Awesome".encodeToByteArray())
Using in your projects¶
dependencies {
implementation("dev.whyoleg.cryptography:cryptography-core:0.4.0")
}
Package dev.whyoleg.cryptography¶
Provides core primitives for creating and accessing CryptographyAlgorithm and CryptographyProvider
Package dev.whyoleg.cryptography.algorithms¶
Provides common algorithms:
- digests (e.g SHA256 and SHA512)
- symmetric ciphers (AES)
- asymmetric encryption and signature (RSA and ECDSA)
- MAC (HMAC)
- Key derivation (PBKDF2 and HKDF)
- Key agreement (ECDH)
Package dev.whyoleg.cryptography.operations¶
Provides APIs to perform cryptography operations:
- hashing
- encryption/decryption and Authenticated encryption/decryption
- signature verification and generation
- secret derivation (KDF/PRF) and shared secret derivation (Key agreement)
Package dev.whyoleg.cryptography.materials.key¶
Provides API for working with keys: encoding, decoding and generation