Features
- Ecliptic curves improvements:
- Implement ECDH via a new shared secret derivation API
- Support ECDSA in Apple provider
- Support both ECDSA signature formats for all providers
- Added RAW private key encoding (encoding secret value)
- Added SEC1/RFC5915 private key encoding
- New algorithms:
- Support for PBKDF2 and HKDF via a new secret derivation API
- Legacy algorithms supported. Make sure you really need them before use:
- AES-ECB – JDK name AES/ECB/PKCS1Padding or AES/ECB/NoPadding
- RSA-PKCS1 (encryption) – JDK name RSA/ECB/PKCS1Padding
- RSA (encryption) – JDK name RSA/ECB/NoPadding
- IO improvements and kotlinx-io integration:
- Support
ByteString
in places whereByteArray
is used - Incremental hashing and signature generation/verification via
HashFunction
,SignFunction
andVerifyFunction
- Support hash/sign/verify over kotlinx-io
Sink
andSource
- Support for streaming encryption/decryption over kotlinx-io
Sink
andSource
- Support
- Add the ability to use custom IV in AES-GCM (#38)
- Allow arbitrary key sizes in HMAC
Breaking changes
- Drop default signature format parameter for ECDSA
- Rename some parameters in algorithms/operations to have better clarity and less noise
- Rename
PEM
andDER
toPem
andDer
respectively - Move operations from subpackages to
operations
packagedev.whyoleg.cryptography.operations.hash.Hasher
was moved todev.whyoleg.cryptography.operations.Hasher
dev.whyoleg.cryptography.operations.cipher.*
was moved todev.whyoleg.cryptography.operations.*
dev.whyoleg.cryptography.operations.signature.*
was moved todev.whyoleg.cryptography.operations.*
- Old declarations are deprecated for removal with
ReplaceWith
- Move algorithms from subpackages to
algorithms
packagedev.whyoleg.cryptography.algorithms.digest.*
was moved todev.whyoleg.cryptography.algorithms.*
dev.whyoleg.cryptography.algorithms.symmetric.*
was moved todev.whyoleg.cryptography.algorithms.*
dev.whyoleg.cryptography.algorithms.asymmetric.*
was moved todev.whyoleg.cryptography.algorithms.*
- Old declarations are deprecated for removal with
ReplaceWith
SymmetricKeySize
was deprecated in favor ofAES.Key.Size
propertiesSignatureVerifier.verifySignature
now throws on invalid signature instead of returningBoolean
SignatureVerifier.tryVerifySignature
is introduced for rare cases when graceful handling is needed
- Renamed AES methods with explicitly provided IV from
encrypt(iv)
/decrypt(iv)
toencryptWithIv(iv)
/decryptWithIv(iv)
to be more
explicit and better distinguish implcit and explict cases CryptographyException
is no longer used:IllegalStateException
is thrown instead
Other improvements
- Kotlin 2.0.20
- Update the prebuilt OpenSSL version to 3.3.2
- Improve ASN.1/DER encoding feature coverage:
- support Context specific tags, both implicit and explicit
- fully support optional and default properties
- support Kotlin inline classes
- add more ASN.1 modules for RSA and EC
- Make
ServiceLoader
usage to be optimized by Android R8
For more information please consult documentation: https://whyoleg.github.io/cryptography-kotlin/