{"id":28317490,"url":"https://github.com/brake/milenage","last_synced_at":"2025-06-24T14:31:17.614Z","repository":{"id":57714055,"uuid":"53517948","full_name":"brake/milenage","owner":"brake","description":"Java implementation of 3GPP™ TS 35.206 Milenage algorithm","archived":false,"fork":false,"pushed_at":"2016-10-15T20:56:31.000Z","size":75,"stargazers_count":13,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-01T14:06:18.119Z","etag":null,"topics":["3gpp","algorithm","calculations","java","javadoc","telecom"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-09T17:37:20.000Z","updated_at":"2024-11-12T07:03:43.000Z","dependencies_parsed_at":"2022-09-26T21:31:11.297Z","dependency_job_id":null,"html_url":"https://github.com/brake/milenage","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/brake/milenage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brake%2Fmilenage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brake%2Fmilenage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brake%2Fmilenage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brake%2Fmilenage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brake","download_url":"https://codeload.github.com/brake/milenage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brake%2Fmilenage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261694125,"owners_count":23195517,"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","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":["3gpp","algorithm","calculations","java","javadoc","telecom"],"created_at":"2025-05-25T05:19:30.082Z","updated_at":"2025-06-24T14:31:17.607Z","avatar_url":"https://github.com/brake.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Milenage for Java\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://opensource.org/licenses/MIT) [![GitHub version](https://badge.fury.io/gh/brake%2Fmilenage.svg)](https://badge.fury.io/gh/brake%2Fmilenage) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.brake.threegpp/milenage/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/com.github.brake.threegpp/milenage) ![Java version 1.7+](https://img.shields.io/badge/Java_version-1.7+-green.svg?style=flat-square) \n\nJava™ library designed to support [3GPP](http://www.3gpp.org)™ Milenage algorithm calculations according to **3GPP TS 35.206**.\nHas written from scratch i.e. is not based on C sourse code from [3GPP](http://www.3gpp.org)™ TS 35.206 Annex 3.\n\n### Table of Contents\n\n* [Features](#features)\n* [Requirements](#requirements)\n* [Download](#download)\n* [Usage](#usage)\n* [Documentation](#documentation)\n* [License](#license)\n* [Alternatives](#alternatives)\n\n## Features\n \n * \u003ccode\u003eOP\u003csub\u003ec\u003c/sub\u003e\u003c/code\u003e calculation based on `OP` and `K`\n * All Authentication and Key Generation \u003ccode\u003ef\u003csub\u003en\u003c/sub\u003e\u003c/code\u003e functions including \u003ccode\u003ef\u003csub\u003e1\u003c/sub\u003e\u003csup\u003e\\*\u003c/sup\u003e\u003c/code\u003e and \u003ccode\u003ef\u003csub\u003e5\u003c/sub\u003e\u003csup\u003e\\*\u003c/sup\u003e\u003c/code\u003e\n * Algorithm customization with `R` and `C` constants \n * Implementation customization:\n \n    There is a `MilenageBuffer` interface supporting all operations Milenage uses under the hood, like bit shift, XOR etc.\n    You can provide your own implementation, but library offers default implementation based on `BigInteger` class.\n    For cryptography purposes library uses `Cipher` object from `javax.crypto` package so you can use any ciphering algorithm having the buffer size 128 bits as well as \"default\" [Rijndael](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard?oldformat=true).\n \n * You can choose method of invocation of Milenage functions:\n \n    * call each function separetely\n    * call a full set of functions at once, in this case a call of every function _can_ be asynchronous.\n        \n        It's configurable through `ExecutorService` object.\n        \n## Requirements\n\nJava 1.7 or higher.\n\n## Download\n\n#### Gradle\n\n```gradle\ncompile 'com.github.brake.threegpp:milenage:1.0.0'\n```\n\n#### Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.brake.threegpp\u003c/groupId\u003e\n  \u003cartifactId\u003emilenage\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n### Basic\n\n```java\n// 1. Create instance of MilenageBufferFactory\u003cBigIntegerBuffer\u003e interface by\n//    instantiating BigIngegerBufferFactory object.\nMilenageBufferFactory\u003cBigIntegerBuffer\u003e bufferFactory = BigIntegerBufferFactory.getInstance();\n\n// 2. Create instance of javax.crypto.Cypher from a key\n//    using a helper class threegpp.milenage.cipher.Ciphers.\n\nCipher cipher = Ciphers.createRijndaelCipher(keyBytes);\n\n// 3. Create OPc value from OP bytes and K, represented by the\n//    previously created Cipher object.\n\nbyte [] OPc = Milenage.calculateOPc(opBytes, cipher, bufferFactory);\n\n// 4. Create the Milenage instance for `OPc` and Cipher instances with MilenageBufferFactory.\n\nMilenage\u003cBigIntegerBuffer\u003e milenage = new Milenage\u003c\u003e(OPc, cipher, bufferFactory);\n\n// 5. Use the Milenage instance with input data (RAND, SQN, AMF)\n\ntry {\n    Map\u003cMilenageResult, byte []\u003e result = melenage.calculateAll(rand, sqn, amf, Executors.newCachedThreadPull);\n\n} catch(InterruptedException | ExecutionExceprtion e) {\n// handle exception\n}\n\n// 6. Use the result\n\nuseMacA(result.get(MilenageResult.MAC_A));\nuseMacS(result.get(MilenateResult.MAC_S));\nuseResponse(result.get(MilenageResult.RES));\nuseConfinentialityKey(result.get(MilenageResult.CK));\nuseIntegrityKey(result.get(MilenageResult.IK));\nuseAnonimityKey(result.get(MilenageResult.AK));\nuseResynchAnonimityKey(result.get(MilenageResult.AK_R))\n\n\n```\n\nYou can see working example in [test code](src/test/java/threegpp/milenage/MilenageTest.java).\n\n### Advanced Usage\n\nTBD\n\n## Documentation\n\n[Javadoc](https://brake.github.io/milenage/)\n\n## License\n\nCopyright © 2015-2016 Constantin Roganov\n\nDistributed under the [MIT License](https://opensource.org/licenses/MIT).  \n\n## Alternatives\n\n1. [This project](http://www.ict-adamantium.eu/SIP-Agent/) has a Milenage implementation (LGPL 2.1)  [Javadoc](http://www.ict-adamantium.eu/SIP-Agent/javadoc/net/java/sip/communicator/sip/security/Milenage.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrake%2Fmilenage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrake%2Fmilenage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrake%2Fmilenage/lists"}