{"id":15068490,"url":"https://github.com/ronhombre/kyberkotlin","last_synced_at":"2025-08-22T05:35:55.080Z","repository":{"id":216113057,"uuid":"731019022","full_name":"ronhombre/KyberKotlin","owner":"ronhombre","description":"ML-KEM's Kotlin Implementation","archived":false,"fork":false,"pushed_at":"2025-06-01T20:14:44.000Z","size":513,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-02T06:13:49.361Z","etag":null,"topics":["cryptography","crystals-kyber","csharp-library","java","java-library","javascript","javascript-library","kotlin-library","kotlin-multiplatform","maven","npm-package"],"latest_commit_sha":null,"homepage":"http://kyber.hombre.asia/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ronhombre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-13T07:19:55.000Z","updated_at":"2025-05-19T00:43:37.000Z","dependencies_parsed_at":"2024-10-13T04:41:23.524Z","dependency_job_id":"b702ac41-9346-43df-bd16-ee33f75ae7a5","html_url":"https://github.com/ronhombre/KyberKotlin","commit_stats":null,"previous_names":["ronhombre/kyberkotlin"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/ronhombre/KyberKotlin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronhombre%2FKyberKotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronhombre%2FKyberKotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronhombre%2FKyberKotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronhombre%2FKyberKotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ronhombre","download_url":"https://codeload.github.com/ronhombre/KyberKotlin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronhombre%2FKyberKotlin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271591353,"owners_count":24786411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","crystals-kyber","csharp-library","java","java-library","javascript","javascript-library","kotlin-library","kotlin-multiplatform","maven","npm-package"],"created_at":"2024-09-25T01:37:32.039Z","updated_at":"2025-08-22T05:35:55.072Z","avatar_url":"https://github.com/ronhombre.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KyberKotlin (2.0.0)\n## _Implements ML-KEM (CRYSTALS-Kyber)_\n_**Digital security for all, everywhere, no matter who they are, or what they believe in.**_\n\n[![CodeQL master](https://github.com/ronhombre/KyberKotlin/actions/workflows/codeql.yml/badge.svg)](https://github.com/ronhombre/KyberKotlin/actions/workflows/codeql.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/asia.hombre/kyber.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22asia.hombre%22)\n[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)\n![Gradle](https://img.shields.io/badge/Gradle-02303A.svg?style=for-the-badge\u0026logo=Gradle\u0026logoColor=white)\n![Kotlin](https://img.shields.io/badge/kotlin-%237F52FF.svg?style=for-the-badge\u0026logo=kotlin\u0026logoColor=white)\n![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)\n![JS](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge\u0026logo=javascript\u0026logoColor=black)\n![Linux Arm64 \u0026 X64](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black)\n![Windows X64](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white)\n![iOS Arm64 \u0026 X64](https://img.shields.io/badge/iOS-000000?style=for-the-badge\u0026logo=ios\u0026logoColor=white)\n![Android Arm32, Arm64, \u0026 X64](https://img.shields.io/badge/Android-3DDC84?style=for-the-badge\u0026logo=android\u0026logoColor=white)\n\n\u003e **ML-KEM** is a key-encapsulation mechanism based on _CRYSTALS-KYBER_. The security of ML-KEM is based on the presumed\n\u003e hardness of the so-called Module Learning with Errors (MLWE) problem, which is a generalization of the Learning With\n\u003e Errors (LWE) problem introduced by Regev in 2005. The hardness of the MLWE problem is itself based on the presumed\n\u003e hardness of certain computational problems in module lattices. This motivates the name of the scheme ML-KEM.\n\n*This is quoted from \n[Section 3.2](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.pdf) of the NIST FIPS 203 document.*\n\n\u003e [!WARNING]\n\u003e If you are using any versions below 1.2.0, you must update to 1.2.0 and above to fix a critical vulnerability in this\n\u003e implementation. In summary, the previous versions were NOT ML-KEM but Kyber. There is a big difference between the\n\u003e two. In addition, the algorithm was sometimes producing rare bit flips that doesn't affect the encaps, decaps process,\n\u003e but it is still a different result than the implementation of others so it would cause confusion once mixed with other\n\u003e libraries seen in #14.\n\n## Introduction\n\nThis is a 100% Kotlin Multiplatform implementation of ML-KEM Final with super fast optimizations.\nIt depends on [KeccakKotlin](https://github.com/ronhombre/KeccakKotlin) and [secure-random](https://github.com/KotlinCrypto/secure-random) Kotlin libraries in order to implement SHA3, SHAKE, and\nSecure Random within the library.\n\n## Capabilities\n* Key Generation (512, 768, 1024)\n* Encapsulation (512, 768, 1024)\n* Decapsulation (512, 768, 1024)\n* Convert to or from bytes.\n\n## Tested Platforms\n* JVM (Java, Kotlin)\n\n## Supported Targets\n\n| Target                    | Arm32              | Arm64              | X64                |\n|---------------------------|--------------------|--------------------|--------------------|\n| JVM (Kotlin \u0026 Java)       | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| Linux                     | :x: *              | :x: **             | :white_check_mark: |\n| Windows (Mingw)           | :x: *              | :x: *              | :white_check_mark: |\n| Android                   | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| iOS                       | :x: *              | :x: **             | :x: **             |\n| iOS Simulator             | :x: *              | :x: **             | :x: *              |\n\n*Note: Some platforms are unavailable/deprecated as targets in Kotlin Multiplatform. Please send your complaints to Jetbrains.\n\n**These targets are currently available, but I have no ability to compile them **yet**. Once I have more free time, I will setup a publishing server to compile to all targets.\n\n## Documentation\n* [kyber.hombre.asia](https://kyber.hombre.asia)\n\n## Installation\n### JVM (Kotlin, Java, Android)\n\n**Requirements: JAVA 8+**\n\nNOTE: if _implementation_ does not work, replace with _compile_.\n\n### Gradle through Maven\n\n`build.gradle`\n\n```groovy\ndependencies {\n    implementation 'asia.hombre:kyber:2.0.0'\n}\n```\n\n### Gradle Kotlin through Maven\n\n`build.gradle.kts`\n\n```kotlin\ndependencies {\n    implementation(\"asia.hombre:kyber:2.0.0\")\n}\n```\n\n### Maven\n\n`pom.xml`\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003easia.hombre\u003c/groupId\u003e\n    \u003cartifactId\u003ekyber\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nCheckout the [Wiki](https://github.com/ronhombre/KyberKotlin/wiki/Installation) for more installation instructions and examples.\n\n## API Usage\n\nCheckout the Wiki or the Documentation for more information.\n\n### References\n\n* [NIST FIPS 203](https://csrc.nist.gov/pubs/fips/203/final)\n* [CRYSTALS-Kyber Algorithm Specs v3.02](https://pq-crystals.org/kyber/data/kyber-specification-round3-20210804.pdf)\n* [kyberJCE](https://github.com/fisherstevenk/kyberJCE)\n* [CCTestVectors](https://github.com/C2SP/CCTV/)\n* [mlkem768](https://github.com/FiloSottile/mlkem768)\n* [kyber (C)](https://github.com/pq-crystals/kyber)\n* [kyber (Rust)](https://github.com/Argyle-Software/kyber)\n* [Montgomery Algorithm](https://www.ams.org/journals/mcom/1985-44-170/S0025-5718-1985-0777282-X/S0025-5718-1985-0777282-X.pdf)\n* [Kyber-K2SO (Go)](https://github.com/symbolicsoft/kyber-k2so)\n* [Kyber on ARM64](https://eprint.iacr.org/2021/561.pdf) _Explains the mysterious Qinv value 62209_\n\n### Special Thanks\n\n* IAmDerek for guiding me in NTT.\n* grhkm for helping me with implementing NTT.\n* versusdkp for providing me a link for intermediates for testing.\n* FiloSottile's mlkem768 which gave me clues to fix bugs in my implementation.\n* Steven Fisher's kyberJCE which helped me run my first tests and use one of its algorithms.\n* and others from CryptoHack community!\n\n### License\n\n```\nCopyright 2025 Ron Lauren Hombre\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n       \n       and included as LICENSE.txt in this Project.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\nAlthough ML-KEM is declared Public Domain, this implementation is created through the efforts of its contributors. As\nsuch, some form of recognition for their work are required for all users of this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronhombre%2Fkyberkotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronhombre%2Fkyberkotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronhombre%2Fkyberkotlin/lists"}