New algorithms
- EdDSA (Ed25519, Ed448) – supported by JDK, OpenSSL, CryptoKit, and WebCrypto providers
- XDH (X25519, X448) – supported by JDK, OpenSSL, CryptoKit, and WebCrypto providers
- ChaCha20-Poly1305 – supported by JDK, OpenSSL, and CryptoKit providers
- Diffie-Hellman (DH) – supported by JDK and OpenSSL providers
- DSA – supported by JDK and OpenSSL providers
- AES-CCM – supported by JDK and OpenSSL providers
- AES-CFB8 (#137), AES-OFB and AES-CFB (legacy) – supported by JDK, OpenSSL, and Apple providers
General Improvements
- JWK (JSON Web Key) encoding support for RSA, ECDSA, XDH, and EdDSA across JDK, OpenSSL, CryptoKit, and Apple providers (in addition to WebCrypto)
- New API to derive a public key from a private key, implemented for all supported algorithms
- Support signing pre-hashed data in ECDSA (#136)
- New
PemDocumentAPI with improved performance, popularPemLabeldefinitions, and extensive documentation - Integrate OpenSSL prebuilt static lib via NativeBuilds (#131)
- Improve
cryptokitprovider Swift compatibility, as well as introduce a newdev.whyoleg.cryptographyGradle plugin to configure the linker options in case Xcode is installed in a non-standard location
Bug fixes
- Fix WebCrypto
EcPrivateKeyimport for Safari compatibility (#124) - Use
O_CLOEXECincryptography-randomto prevent file descriptor inheritance on Linux (#138)
Breaking changes
- Refactored key-related abstractions, introducing interfaces for encoding to support DH parameters more naturally:
dev.whyoleg.cryptography.materials.key.Keyinterface was deprecated without replacementEncodableKey,KeyDecoder, andKeyFormatfromdev.whyoleg.cryptography.materials.keypackage were replaced byEncodable,DecoderandEncodingFormatinterfaces indev.whyoleg.cryptography.materialspackagedev.whyoleg.cryptography.materials.key.KeyGeneratorwas renamed todev.whyoleg.cryptography.operations.KeyGeneratorEC.PrivateKeyandRSA.PrivateKeynow have generic typesEC.PrivateKey<PublicK>andRSA.PrivateKey<PublicK>
AES.IvCipher,AES.IvAuthenticatedCipherand all related IV cipher interfaces were extracted fromAESand moved todev.whyoleg.cryptography.operations.*(e.g.IvCipher,IvAuthenticatedCipher,IvEncryptor,IvDecryptor)PemLabel.representationproperty was renamed toPemLabel.valuein thecryptography-serialization-pemmodule- Simplified
AlgorithmIdentifierhierarchy by removingKeyAlgorithmIdentifierin the ASN.1 module - Refactored
AlgorithmIdentifierSerializerfor better extensibility and optional parameters support
Testing improvements
- WebCrypto provider now supports running tests in Safari in addition to Chrome (#124)
- Build Framework/XCFramework for all Apple providers, for all targets
Documentation improvements
- Comprehensive KDoc documentation for all core APIs: algorithms, operations, and materials
- Reworked the documentation website with a lot of new content!
Other improvements
- Kotlin 2.2.0 -> 2.3.20
- kotlinx-io 0.8.0 -> 0.9.0
- kotlinx-serialization 1.8.1 -> 1.10.0
- Update the prebuilt OpenSSL version to 3.6.0
- BigInt:
- introduce magnitude-based and unary operators
- ASN.1:
- add OIDs and AlgorithmIdentifiers for X25519, X448, Ed25519 and Ed448
- support optional
publicKeyinPrivateKeyInfo(OneAsymmetricKey) - support DH algorithm and parameter serialization
- Generalize ECDSA signatures as DSS for both ECDSA and DSA
For more information, please consult the documentation: https://whyoleg.github.io/cryptography-kotlin/