BroadNet
Protocols BroadNet answer

Milenage algorithm — 3GPP authentication explained

Last reviewed 2 min readReviewed by BroadNet engineering
Quick answer

Milenage is the 3GPP-standardised authentication and key-generation algorithm that every GSM/UMTS/LTE network uses to verify a subscriber and derive session keys. It runs inside the SIM/eUICC and inside the operator's HLR/HSS, taking the subscriber's Ki (long-term key), OPc (operator-customised constant), and a network random challenge (RAND), and producing the response (RES), the ciphering key (CK), the integrity key (IK), and an anonymity key (AK). It is the cryptographic foundation of mobile authentication.

Plain-language definitionVendor-neutralReviewed September 29, 2026
The long answer

Everything worth knowing, nothing that isn't.

§01

What it actually does

Milenage is built around five AES-128 invocations (f1, f1*, f2, f3, f4, f5) keyed by Ki, with OPc mixed in for per-operator domain separation. The network sends RAND, the SIM/eUICC runs Milenage with its stored Ki/OPc, returns RES plus authentication parameters. The network checks RES against its own computation. If they match, the subscriber is authenticated and the session keys CK/IK are derived. This same flow runs on every cell attach, every paging response, every authentication challenge — billions of times per day globally.

§02

Why it matters commercially

Milenage is the reason operators can trust the device — without it, there is no operator network, no SMS, no voice, no data. For an eSIM Subscription Manager, the act of personalising a profile means writing a unique Ki + OPc pair into a fresh ISD-P. The Ki/OPc generation must be cryptographically strong, archived for HLR/HSS provisioning, and never transmitted in cleartext outside the HSM boundary. BroadNet's eSIM VSM platform (/operators/esim-vsm) generates Milenage Ki/OPc inside a FIPS 140-2 Level 3 HSM environment.

§03

Latency, scale, and compliance angle

Milenage on a modern SIM/eUICC executes in 5-20 ms. On an HSS at scale, batch authentication-vector generation runs at 10K-50K vectors/sec per HSM. Compliance: Milenage is the GSMA-mandated default for 4G; TUAK is an alternative for higher-security profiles (see /answers/tuak-algorithm). All Milenage Ki/OPc material is in scope for SAS-SM key-custody audit.

§04

Privacy and compliance considerations

Compromise of Ki/OPc means the subscriber can be impersonated and their traffic decrypted indefinitely. There is no recovery beyond re-personalising a new profile. This is why Ki never leaves the secure element on the device side, why HSS database backups are encrypted and access-controlled, and why HSM ceremonies for Ki generation are dual-control with split-key custody. The whole SAS-SM regime exists, fundamentally, to protect Milenage key material.

BNWritten by the BroadNet engineering team·Operating carrier-grade messaging since 2003, headquartered in Dubai·Editorial standards
Build with this

Need help wiring this up?

The pages below are the products and integration guides that put this concept on the wire. If you'd rather walk through it live, our engineering team takes calls same-day during MENA working hours.

Talk to our engineering team
Feedback

Was this answer helpful?

Your vote helps us prioritise which answers to expand with examples, diagrams, and code snippets.

Was this answer helpful?
Thanks — noted. We'll keep this answer maintained.
Got it. Tell us what was missing — send a quick note.

How we write and review content

Still need help?

Talk to a real engineer about your build.

We reply within one business day, and production accounts get 24/7 support. Our solutions engineers ship code, not scripts.

$ curl -X POST https://api.broadnet.me/sms/sendSms
Response SLA
Test-access requestsReply within 1 business day
Production24 / 7 · < 15 min
Operator NOC24 / 7 · pager