Skip to content

brake/milenage-clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clojars Project License

threegpp.milenage-clj

A Clojure library designed to support 3GPP™ Milenage algorithm calculations according to 3GPP TS 35.206.

Features:

  • OPc calculation based on OP and K
  • f1-f5 functions including f1* and f5*
  • Algorithm customization with R and C constants
  • You can use bundled Rijndael or any other instance of javax.crypto.Cipher

Usage

  1. Create cipher javax.crypto.Cipher, it will act as representation of a ciphering key K
(milenage-clj/create-rijndael-cipher k)
  1. Create a MilenageConstants record with sample (AKA "default") or your own values.
milenage-clj/sample-milenage-constants  ; sample values
(milenage-clj/milenage-constants c-const-map r-const-map)  ; your own values

Where c-const-map is a map of byte arrays with keys {:c1 :c2 :c3 :c4 :c5} and r-const-map is a map with byte values and keys {:r1 :r2 :r3 :r4 :r5}

  1. Calculate OPc from OP and cipher
(milenage-clj/opc cipher op-bytes)
  1. Call appropriate Milenage function:
  • f2-all -> :f1, :f1*
  • f2f5 -> :f2, :f5
  • f3
  • f4
  • f5*

You can use test module as an example of usage.

Current Implementation details

Internally, for a bit arithmetic, module uses a java.math.BigInteger

License

Copyright © 2015-2016 Constantin Roganov

Distributed under the MIT License.

About

3GPP Milenage calculation implemented in Clojure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published