Skip to content

Krypton is a suite of libraries to implement cryptographic primitives and systems into your Kotlin Multiplatform application

License

Notifications You must be signed in to change notification settings

karmakrafts/Krypton

Repository files navigation

Krypton - KMP Cryptography Library

Krypton is a library that implements the cryptographic primitives like ciphers or hash functions into Kotlin Multiplatform. This library uses the system dependency and other external library's for the implementations to reduce the risk of more bugs in the cryptological core. Below this text you can see a list of the implemented algorithms, hash functions and more:

  • Hash Functions: SHA3 (224, 256, 384 and 512 bits), SHA (224, 256, 384 and 512 bits) and MD5
  • Ciphers: AES (128, 192 and 256 bits) and RSA
  • Signatures: RSA (ECSDA is implemented but unstable)
  • Key Agreements: Diffie-Hellman (DH) and Elliptic Curve Diffie-Hellman (ECDH)
  • Elliptic curves: All curves supported by all platforms together

Below this text you can see the list of backends used on different platforms:

Credits

Some parts of this project are based on the work of other great people. In this part of the README I want to thank them and show a list of my inspirations etc.

Dependencies

Also, a few dependencies are needed to make this project work. Below this text you can see a list of these project with author and license (by the time the dependency was added):

Name Author License
Kotest Kotest Apache License 2.0
okio Square Apache License 2.0
bouncycastle-java Legion of the Bouncycastle Inc. MIT License
dokka Kotlin Apache License 2.0
bignum Ugljesa Jovanovic Apache License 2.0
OpenSSL The OpenSSL Project Apache License 2.0

ToDo's

  • Keys, Key Generator and Keypair Generator
  • Hashing algorithms and digest
  • Default curves
  • Cipher class for (a)symmetric encryption algorithms
  • KeyAgreement class for key agreement algorithms
  • Signature class for signature algorithms
  • Rewrite supportedBitSize to bitSizePredicate and implement it into the key generators in Algorithm
  • Post-quantum algorithms like CRYSTALS-Dilithium (#3)
  • Key derivation functions (KDF) like HDKF
  • Message Authentication Codes
  • Support for dynamic-length hash functions like SHAKE-128
  • Add support for key stores
  • Custom elliptic curves (#2)
  • Deprecated or unsecure ciphers like DES or Triple-DES

License

This project is licensed with the Apache-2.0 License.

Copyright 2024 Karma Krafts & associates
  
Licensed under the Apache License, Version 2.0 (the "License");  
you may not use this file except in compliance with the License.  
You may obtain a copy of the License at  
  
    http://www.apache.org/licenses/LICENSE-2.0  
  
Unless required by applicable law or agreed to in writing, software  
distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
See the License for the specific language governing permissions and  
limitations under the License.