Language Switcher

Quotation cart

Your quote cart is empty!

Knowledge Base - Calculations: How to calculate OPc

How to calculate OPc - example

Some of our customers edit the USIM cards themselves with tools like Card Admin. And our SMAGT series of cards only accept OPc value (some other cards have an internal function to calculate OPc value from Ki and OP, if OP value was entered). Now OPc can actually be calculated in any way the Operator decides. It must no be calculated in a certain way. But in all test cards and probably for many operators as well, the standard formula is OPc=AES128(Ki,OP) XOR OP. I'll show you a way to calculate OPc with some online tools on the Internet.

Best practice note: Why is storing OPc on card more preferable than storing the actual OP value?

It is more likely that OP can be kept secret if OP is not stored on the USIM, as it then only takes one USIM to be reverse engineered for OP to be discovered and published. Hence 3GPP TS 35.205 recommends that OPc is calculated off USIM and then stored in each card as an individual value. This will allow OP to be better protected than if OP had been stored in every card.

Note that it is a two-step process! Take the result from the first step and enter into the second step!

AES encryption (128 bits)

Screenshot 2017 02 01 10.17.08

Go to:

Enter Ki value in the first field (Key)

Enter OP value in the third field (Input Data)

Select CBC

Click Encrypt

Copy the Encrypted value and enter it into the next step, see below.
(You may also download a tool (Java application) here: )


XOR calculation

Screenshot 2017 02 01 10.28.21

Go to:

Enter the calculated value from previous step in the first field (Input 1)

Enter the OP value in the second field (Input 2)

The XOR result = your OPc value !

You may also download a tool  (Java application) here




Created : 2016-05-23 11:07:43, Last Modified : 2017-11-01 14:51:43

User Comments

Keyword Search

Newsletter signup

Subscribe to our mailing list
* indicates required
By subscribing you accept our