分类目录归档:sim

移动通信鉴权算法之三Milenage

UMTS/WCDMA,LTE,5G NR基本鉴权算法都是一致的,为Milenage。 UMTS是一个基于五元组的鉴权 鉴权五元组(RAND,XRES,IK,CK,AUTN)。 LTE鉴权是一个基于四元组的鉴权:Kasme、AUTN、RAND、XRES,鉴权流程为:
1) UE向NAS层MMS发起鉴权请求;
2) MME(Mobility Management Entity) 则向HSS(Home Subscriber Server)索要鉴权向量;
3) HSS返回一套或多套EPS鉴权向量给MME,其中包括AMF分割符,1代表LTE/SAE,0代表非LTE/SAE;
4) MME收到后保存XRES,Kasme并将RAND和AUTN发送给UE;
5) UE通过AUTN对网络进行鉴权,并根据AUTN和RAND计算出RES和CK/IK,进一步计算出Kasme;
6) UE与MME根据Kasme推导出NAS层与AS层所需的CK、IK。当UE从ACTIVE到IDLE态时将删除这些密钥 VLR通过基站-手机发送 RAND和AUTN到USIM卡
RAND由AuC用f0算法生成
AUTN= SQN [AAK] || AMF || MAC_A


USIM用f1 计算XMAC,输入为 SQN || RAND || AMF
若 XMAC = MAC_A ,且SQN在有效范围, 则认为网络是合法网络,不是伪基站(其实伪基站这个叫法不对,但民间都这么称呼)

USIM用f2 计算RES

当SQN不在有效范围时,用f1*进行同步 TD-LTE USIM卡和TD-SCDMA USIM卡USIM应用和SIM应用均使用Milenage算法, LTE卡支持AMF分隔符为1的LTE模式。 外在表现主要差异在于EF_UST(6F38)文件中声明支持EPS Mobility Management Information服务和Call control on EPS PDN connection by USIM服务。
在文件系统中ADF下新增EPS_LOCI(6FE3)和EPS_NSC(6FE4)两个文件由终端访问和存储鉴权中间值。 实例分析:
00 A4 08 04 02 

A4 

7F FF 

61 34 


00 C0 00 00 34 

C0 

62 32 82 02 78 21 83 02 7F F0 84 10 A0 00 00 00 

87 10 02 FF 86 FF 03 89 FF FF FF FF A5 03 80 01 

71 8A 01 05 8B 03 2F 06 04 C6 09 90 01 40 83 01 

01 83 01 81 

90 00 



00 88 00 81 (80=2g,81=3g, 82=vgcs, 84=gba) 22 

88 

10 

D3 5E 1C AD 1F 84 8C 90 69 66 39 D3 0E 12 7F 32  (RAND)

10 

58 11 8D A8 EE 70(SQN@AK)-- F2 4C (AMF) ---2B 33 55 DC B7 26 43 8E (MAC_A) (AUTN)

61 2C 



其中,AUTN实际由SQN xor AK, AMF 和 MAC 三部分组成^M

AK = f5(Ki,RAND)^M

XMAC = f1(Ki,RAND,SQN,AMF)^M

如果XMAC与MAC相等, 则认为UE将要接入的网络是合法的^M



00 C0 00 00 2C 

C0 

DB      --DB表示成功, DC表示SQN需要重新同步

08 

F8 CD 98 87 CA 77 04 8F    --RES

10 

D3 EF 06 E5 86 28 F1 94 3A 57 2B 4B 20 06 1B F4 --CK

10 

AF 9B 2F 86 F5 92 85 8F 03 21 24 8A BB F3 A1 5A --IK

08 
2B 33 55 DC B7 26 43 8E  (MAC_A)

90 00 
鉴权管理字段

对AMF的使用没有标准化。除了参与AUTN的计算以外,3GPP提出了三种用法
1.用于在多个鉴权算法、多个密钥中进行选择。
2.用于动态改变SQN验证所用的参数L
3.初步确定使用该项功能:用于指定CK/IK密钥生命周期的阈值。
理由:
AMF用于动态更新threadhold,如果KASUMI算法有问题,通过增大CK、IK的更新频度提高使用KASUMI算法的安全程度。

考虑到AMF还没有标准化,并且今后可能用于中国移动特定的功能,设置AMF = 0x00 0x01 也就是分离比特位 如果网络类型为LTE, AUTN中的AMF字段的”分离比特位”应该设置为1, 向ME指明 认证向量 仅用于 EPS上下文的AKA认证.
如果”分离比特位”为0, 向量仅能用于 非EPS上下文(如GSM, UMTS)的AKA认证.

对于”分离比特位”为1的认证向量, AKA认证过程产生的密钥CK和IK 应该驻留在HSS中
分离比特位 是 AMF字段的最低位, 不应再被用于其他用途 AMF(authentication and key management field):AMF用来指示SQNMS(移动站的)和SQN(VLR或Auc的)之间的最大许可差值;其用来指示生成某一个鉴权向量所使用的密钥和算法。USIM对密钥有一个有效期限制,通过AMF来调整它的时间。
若SQN – SQNMS < AMF 且SQN > SQNMS,则SQN正确
AUTS:它的长度为14个字节,当MS鉴权失败并且返回失败原因是”同步失败”时,带有AUTS参数,其作用是为启动再鉴权流程而给网络提供必要的信息。 “Synchronisation failure” tag = ‘DC’ “Successful 3G authentication” tag = ‘DB’

Extended Preferred Roaming List

PRL_Design_Maintenance_and_Testing_v1.1电信 LTE+CDMA 同时入网需要

http://www.cdg.org/roaming/roaming_resources/prltools/index.asp
PRL 编辑工具

捷德2015

111901F5038101C0010A80030B391B1923C85004E0EE09400B0E0025004E007700A000C900F2011B0A12282F2837283C2861286E289328A028D229040B040025004E0304106F1820030410287FC00B02007A4040006C000301C071E002460FFF013600FFFF0180E04060006C020301C04060006C040301C04060006C060301C04060006C080301C04060006C0A0301C04060006C0C0301C04060006C0E0301C04060006C100301C04060006C120301C04060006C140301C04060006C160301C04060006C180301C04060006C1A0301C04060006C1C0301C04060006C1E0301C04060006C200301C04060006C220301C04060006C240301C04060006C260301C0

4060006C280301C04060006C2A0301C04060006C2C0301C04060006C2E0301C04060006C300301C04060006C320301C04060006C340301C04060006C360301C04060006C380301C04060006C3A0301C04060006C3C0301C04060006C3E0301C04060006C400301C04060006C420301C04060006C440301C04060006C460301C04060006C480301C04060006C4A0301C04060006C4C0301C04060006C4E0301C04060006C500301C04060006C520301C04060006C540301C04060006C560301C04060006C580301C04060006C5A0301C04060006C5C0301C04060006C5E0301C04060006C600301C04060006C620301C04060006C640301C04060006C660301C0

4060006C680301C04060006C6A0301C04060006C6C0301C04060006C6E0301C04060006C700301C04060006C720301C04060006C740301C04060006C760301C04060006C780301C04060006C7A0301C04060006C7C0301C04060006C7E0301C04060006C800301C04060006C820301C04060006C840301C04060006C860301C04060006C880301C04060006C8A0301C04060006C8C0301C04060006C8E0301C04060006C900301C04060006C920301C04060006C940301C04060006C960301C04060006C980301C04060006C9A0301C04060006C9C0301C04060006C9E0301C04060006CA00301C04060006CA20301C04060006CA40301C04060006CA60301C0

4060006CA80301C04060006CAA0301C04060006CAC0301C04060006CAE0301C04060006CB00301C04060006CB20301C04060006CB40301C04060006CB60301C04060006CB80301C04060006CBA0301C04060006CBC0301C04060006CBE0301C04060006CC00301C04060006CC20301C04060006CC40301C04060006CC60301C04060006CC80301C04060006CCA0301C04060006CCC0301C04060006CCE0301C04060006CD00301C04060006CD20301C04060006CD40301C04060006CD60301C04060006CD80301C04060006CDA0301C04060006CDC0301C04060006CDE0301C04060006CE00301C04060006CE20301C04060006CE40301C04060006CE60301C0

4060006CE80301C04060006CEA0301C04060006CEC0301C04060006CEE0301C04060006CF00301C04060006CF20301C04060006CF40301C04060006CF60301C04060006CF80301C04060006CFA0301C04060006CFC0301C04060006CFE0301C04060006D000301C04060006D020301C04060006D040301C04060006D060301C04060006D080301C04060006D0A0301C04060006D0C0301C04060006D0E0301C04060006D100301C04060006D120301C04060006D140301C04060006D160301C04060006D180301C04060006D1A0301C04060006D1C0301C04060006D1E0301C04060006D200301C04060006D220301C04060006D240301C04060006D260301C0

4060006D280301C04060006D2A0301C04060006D2C0301C04060006D2E0301C04060006D300301C04060006D320301C04060006D340301C04060006D360301C04060006D380301C04060006D3A0301C04060006D3C0301C04060006D3E0301C04060006D400301C04060006D420301C04060006D440301C04060006D460301C04060006D480301C04060006D4A0301C04060006D4C0301C04060006D4E0301C04060006D500301C04060006D520301C04060006D540301C04060006D560301C04060006D580301C04060006D5A0301C04060006D5C0301C04060006D5E0301C04060006D600301C04060006D620301C04060006D640301C04060006D660301C0

4060006D680301C04060006D6A0301C04060006D6C0301C04060006D6E0301C04060006D700301C04060006D720301C04060006D740301C04060006D760301C04060006D780301C04060006D7A0301C04060006D7C0301C04060006D7E0301C04060006D800301C04060006D820301C04060006D840301C04060006D860301C04060006D880301C04060006D8A0301C04060006D8C0301C04060006D8E0301C04060006D900301C04060006D920301C04060006D940301C04060006D960301C04060006D980301C04060006D9A0301C04060006D9C0301C04060006D9E0301C04060006DA00301C04060006DA20301C04060006DA40301C04060006DA60301C0

4060006DA80301C04060006DAA0301C04060006DAC0301C04060006DAE0301C04060006DB00301C04060006DB20301C04060006DB40301C04060006DB60301C04060006DB80301C04060006DBA0301C04060006DBC0301C04060006DBE0301C04060006DC00301C04060006DC20301C04060006DC40301C04060006DC60301C04060006DC80301C04060006DCA0301C04060006DCC0301C04060006DCE0301C04060006DD00301C04060006DD20301C04060006DD40301C04060006DD60301C04060006DD80301C04060006DDA0301C04060006DDC0301C04060006DDE0301C04060006DE00301C04060006DE20301C04060006DE40301C04060006DE60301C0

4060006DE80301C04060006DEA0301C04060006DEC0301C04060006DEE0301C04060006DF00301C04060006DF20301C04060006DF40301C04060006DF60301C04060006DF80301C04060006DFA0301C04060006DFC0301C04060006DFE0301C04060006E000301C04060006E020301C04060006E040301C04060006E060301C04060006E080301C04060006E0A0301C04060006E0C0301C04060006E0E0301C04060006E100301C04060006E120301C04060006E140301C04060006E160301C04060006E180301C04060006E1A0301C04060006E1C0301C04060006E1E0301C04060006E200301C04060006E220301C04060006E240301C04060006E260301C0

4060006E280301C04060006E2A0301C04060006E2C0301C04060006E2E0301C04060006E300301C04060006E320301C04060006E340301C04060006E360301C04060006E380301C04060006E3A0301C04060006E3C0301C04060006E3E0301C04060006E400301C04060006E420301C04060006E440301C04060006E460301C04060006E480301C04060006E4A0301C04060006E4C0301C04060006E4E0301C04060006E500301C04060006E520301C04060006E540301C04060006E560301C04060006E580301C04060006E5A0301C04060006E5C0301C04060006E5E0301C04060006E600301C04060006E620301C04060006E640301C04060006E660301C0

4060006E680301C04060006E6A0301C04060006E6C0301C04060006E6E0301C04060006E700301C04060006E720301C04060006E740301C04060006E760301C04060006E780301C04060006E7A0301C04060006E7C0301C04060006E7E0301C04060006E800301C04060006E820301C04060006E840301C04060006E860301C04060006E880301C04060006E8A0301C04060006E8C0301C04060006E8E0301C04060006E900301C04060006E920301C04060006E940301C04060006E960301C04060006E980301C04060006E9A0301C04060006E9C0301C04060006E9E0301C04060006EA00301C04060006EA20301C04060006EA40301C04060006EA60301C0

4060006EA80301C04060006EAA0301C04060006EAC0301C04060006EAE0301C04060006EB00301C04060006EB20301C04060006EB40301C04060006EB60301C04060006EB80301C04060006EBA0301C04060006EBC0301C04060006EBE0301C04060006EC00301C04060006EC20301C04060006EC40301C04060006EC60301C04060006EC80301C04060006ECA0301C04060006ECC0301C04060006ECE0301C04060006ED00301C04060006ED20301C04060006ED40301C04060006ED60301C04060006ED80301C04060006EDA0301C04060006EDC0301C04060006EDE0301C04060006EE00301C04060006EE20301C04060006EE40301C04060006EE60301C0

4060006EE80301C04060006EEA0301C04060006EEC0301C04060006EEE0301C04060006EF00301C04060006EF20301C04060006EF40301C04060006EF60301C04060006EF80301C04060006EFA0301C04060006EFC0301C04060006EFE0301C04060006F000301C04060006F020301C04060006F040301C04060006F060301C04060006F080301C04060006F0A0301C04060006F0C0301C04060006F0E0301C04060006F100301C04060006F120301C04060006F140301C04060006F160301C04060006F180301C04060006F1A0301C04060006F1C0301C04060006F1E0301C04060006F200301C04060006F220301C04060006F240301C04060006F260301C0

4060006F280301C04060006F2A0301C04060006F2C0301C04060006F2E0301C04060006F300301C04060006F320301C04060006F340301C04060006F360301C04060006F380301C04060006F3A0301C04060006F3C0301C04060006F3E0301C04060006F400301C04060006F420301C04060006F440301C04060006F460301C04060006F480301C04060006F4A0301C04060006F4C0301C04060006F4E0301C04060006F500301C04060006F520301C04060006F540301C04060006F560301C04060006F580301C04060006F5A0301C04060006F5C0301C04060006F5E0301C04060006F600301C04060006F620301C04060006F640301C04060006F660301C0

4060006F680301C04060006F6A0301C04060006F6C0301C04060006F6E0301C04060006F700301C04060006F720301C04060006F740301C04060006F760301C04060006F780301C04060006F7A0301C04060006F7C0301C04060006F7E0301C04060006F800301C04060006F820301C04060006F840301C04060006F860301C04060006F880301C04060006F8A0301C04060006F8C0301C04060006F8E0301C04060006F900301C04060006F920301C04060006F940301C04060006F960301C04060006F980301C04060006F9A0301C04060006F9C0301C04060006F9E0301C04060006FA00301C04060006FA20301C04060006FA40301C04060006FA60301C0

4060006FA80301C04060006FAA0301C04060006FAC0301C04060006FAE0301C04060006FB00301C04060006FB20301C04060006FB40301C04060006FB60301C04060006FB80301C04060006FBA0301C04060006FBC0301C04060006FBE0301C04060006FC00301C04060006FC20301C04060006FC40301C04060006FC60301C04060006FC80301C04060006FCA0301C04060006FCC0301C04060006FCE0301C04060006FD00301C04060006FD20301C04060006FD40301C04060006FD60301C04060006FD80301C04060006FDA0301C04060006FDC0301C04060006FDE0301C04060006FE00301C04060006FE20301C04060006FE40301C04060006FE60301C0

4060006FE80301C04060006FEA0301C04060006FEC0301C04060006FEE0301C04060006FF00301C04060006FF20301C04060006FF40301C04060006FF60301C04060006FF80301C04060006FFA0301C04060006FFC0301C04060006FFE0301C058E0082300A8C00060301C304010000002404000584001010071E002455FFF012C20FFFF00808058E0182300A8AA04001010304020115C0069E022450FFF0108AEFFFF0000306020117800404028606001010071E02A440FFF013030FFFF0080804060286062010100406028606401010040602860660101004060286068010100406028606A010100406028606C010100406028606E01010040602860200101

00406028602201010070E03037FEC0000000000801010084D3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000



...

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

恒宝2017

108401F403810100010300030B391B1923C85004E0EE09400B0E0025004E007700A000C900F2011B0A12282F2837283C2861286E289328A028D229040B040025004E4040006C000301C071E002460FFF013600FFFF0180E04060006C020301C04060006C040301C04060006C060301C04060006C080301C04060006C0A0301C04060006C0C0301C04060006C0E0301C04060006C100301C04060006C120301C04060006C140301C04060006C160301C04060006C180301C04060006C1A0301C04060006C1C0301C04060006C1E0301C04060006C200301C04060006C220301C04060006C240301C04060006C260301C04060006C280301C04060006C2A0301C0

4060006C2C0301C04060006C2E0301C04060006C300301C04060006C320301C04060006C340301C04060006C360301C04060006C380301C04060006C3A0301C04060006C3C0301C04060006C3E0301C04060006C400301C04060006C420301C04060006C440301C04060006C460301C04060006C480301C04060006C4A0301C04060006C4C0301C04060006C4E0301C04060006C500301C04060006C520301C04060006C540301C04060006C560301C04060006C580301C04060006C5A0301C04060006C5C0301C04060006C5E0301C04060006C600301C04060006C620301C04060006C640301C04060006C660301C04060006C680301C04060006C6A0301C0

4060006C6C0301C04060006C6E0301C04060006C700301C04060006C720301C04060006C740301C04060006C760301C04060006C780301C04060006C7A0301C04060006C7C0301C04060006C7E0301C04060006C800301C04060006C820301C04060006C840301C04060006C860301C04060006C880301C04060006C8A0301C04060006C8C0301C04060006C8E0301C04060006C900301C04060006C920301C04060006C940301C04060006C960301C04060006C980301C04060006C9A0301C04060006C9C0301C04060006C9E0301C04060006CA00301C04060006CA20301C04060006CA40301C04060006CA60301C04060006CA80301C04060006CAA0301C0

4060006CAC0301C04060006CAE0301C04060006CB00301C04060006CB20301C04060006CB40301C04060006CB60301C04060006CB80301C04060006CBA0301C04060006CBC0301C04060006CBE0301C04060006CC00301C04060006CC20301C04060006CC40301C04060006CC60301C04060006CC80301C04060006CCA0301C04060006CCC0301C04060006CCE0301C04060006CD00301C04060006CD20301C04060006CD40301C04060006CD60301C04060006CD80301C04060006CDA0301C04060006CDC0301C04060006CDE0301C04060006CE00301C04060006CE20301C04060006CE40301C04060006CE60301C04060006CE80301C04060006CEA0301C0

4060006CEC0301C04060006CEE0301C04060006CF00301C04060006CF20301C04060006CF40301C04060006CF60301C04060006CF80301C04060006CFA0301C04060006CFC0301C04060006CFE0301C04060006D000301C04060006D020301C04060006D040301C04060006D060301C04060006D080301C04060006D0A0301C04060006D0C0301C04060006D0E0301C04060006D100301C04060006D120301C04060006D140301C04060006D160301C04060006D180301C04060006D1A0301C04060006D1C0301C04060006D1E0301C04060006D200301C04060006D220301C04060006D240301C04060006D260301C04060006D280301C04060006D2A0301C0

4060006D2C0301C04060006D2E0301C04060006D300301C04060006D320301C04060006D340301C04060006D360301C04060006D380301C04060006D3A0301C04060006D3C0301C04060006D3E0301C04060006D400301C04060006D420301C04060006D440301C04060006D460301C04060006D480301C04060006D4A0301C04060006D4C0301C04060006D4E0301C04060006D500301C04060006D520301C04060006D540301C04060006D560301C04060006D580301C04060006D5A0301C04060006D5C0301C04060006D5E0301C04060006D600301C04060006D620301C04060006D640301C04060006D660301C04060006D680301C04060006D6A0301C0

4060006D6C0301C04060006D6E0301C04060006D700301C04060006D720301C04060006D740301C04060006D760301C04060006D780301C04060006D7A0301C04060006D7C0301C04060006D7E0301C04060006D800301C04060006D820301C04060006D840301C04060006D860301C04060006D880301C04060006D8A0301C04060006D8C0301C04060006D8E0301C04060006D900301C04060006D920301C04060006D940301C04060006D960301C04060006D980301C04060006D9A0301C04060006D9C0301C04060006D9E0301C04060006DA00301C04060006DA20301C04060006DA40301C04060006DA60301C04060006DA80301C04060006DAA0301C0

4060006DAC0301C04060006DAE0301C04060006DB00301C04060006DB20301C04060006DB40301C04060006DB60301C04060006DB80301C04060006DBA0301C04060006DBC0301C04060006DBE0301C04060006DC00301C04060006DC20301C04060006DC40301C04060006DC60301C04060006DC80301C04060006DCA0301C04060006DCC0301C04060006DCE0301C04060006DD00301C04060006DD20301C04060006DD40301C04060006DD60301C04060006DD80301C04060006DDA0301C04060006DDC0301C04060006DDE0301C04060006DE00301C04060006DE20301C04060006DE40301C04060006DE60301C04060006DE80301C04060006DEA0301C0

4060006DEC0301C04060006DEE0301C04060006DF00301C04060006DF20301C04060006DF40301C04060006DF60301C04060006DF80301C04060006DFA0301C04060006DFC0301C04060006DFE0301C04060006E000301C04060006E020301C04060006E040301C04060006E060301C04060006E080301C04060006E0A0301C04060006E0C0301C04060006E0E0301C04060006E100301C04060006E120301C04060006E140301C04060006E160301C04060006E180301C04060006E1A0301C04060006E1C0301C04060006E1E0301C04060006E200301C04060006E220301C04060006E240301C04060006E260301C04060006E280301C04060006E2A0301C0

4060006E2C0301C04060006E2E0301C04060006E300301C04060006E320301C04060006E340301C04060006E360301C04060006E380301C04060006E3A0301C04060006E3C0301C04060006E3E0301C04060006E400301C04060006E420301C04060006E440301C04060006E460301C04060006E480301C04060006E4A0301C04060006E4C0301C04060006E4E0301C04060006E500301C04060006E520301C04060006E540301C04060006E560301C04060006E580301C04060006E5A0301C04060006E5C0301C04060006E5E0301C04060006E600301C04060006E620301C04060006E640301C04060006E660301C04060006E680301C04060006E6A0301C0

4060006E6C0301C04060006E6E0301C04060006E700301C04060006E720301C04060006E740301C04060006E760301C04060006E780301C04060006E7A0301C04060006E7C0301C04060006E7E0301C04060006E800301C04060006E820301C04060006E840301C04060006E860301C04060006E880301C04060006E8A0301C04060006E8C0301C04060006E8E0301C04060006E900301C04060006E920301C04060006E940301C04060006E960301C04060006E980301C04060006E9A0301C04060006E9C0301C04060006E9E0301C04060006EA00301C04060006EA20301C04060006EA40301C04060006EA60301C04060006EA80301C04060006EAA0301C0

4060006EAC0301C04060006EAE0301C04060006EB00301C04060006EB20301C04060006EB40301C04060006EB60301C04060006EB80301C04060006EBA0301C04060006EBC0301C04060006EBE0301C04060006EC00301C04060006EC20301C04060006EC40301C04060006EC60301C04060006EC80301C04060006ECA0301C04060006ECC0301C04060006ECE0301C04060006ED00301C04060006ED20301C04060006ED40301C04060006ED60301C04060006ED80301C04060006EDA0301C04060006EDC0301C04060006EDE0301C04060006EE00301C04060006EE20301C04060006EE40301C04060006EE60301C04060006EE80301C04060006EEA0301C0

4060006EEC0301C04060006EEE0301C04060006EF00301C04060006EF20301C04060006EF40301C04060006EF60301C04060006EF80301C04060006EFA0301C04060006EFC0301C04060006EFE0301C04060006F000301C04060006F020301C04060006F040301C04060006F060301C04060006F080301C04060006F0A0301C04060006F0C0301C04060006F0E0301C04060006F100301C04060006F120301C04060006F140301C04060006F160301C04060006F180301C04060006F1A0301C04060006F1C0301C04060006F1E0301C04060006F200301C04060006F220301C04060006F240301C04060006F260301C04060006F280301C04060006F2A0301C0

4060006F2C0301C04060006F2E0301C04060006F300301C04060006F320301C04060006F340301C04060006F360301C04060006F380301C04060006F3A0301C04060006F3C0301C04060006F3E0301C04060006F400301C04060006F420301C04060006F440301C04060006F460301C04060006F480301C04060006F4A0301C04060006F4C0301C04060006F4E0301C04060006F500301C04060006F520301C04060006F540301C04060006F560301C04060006F580301C04060006F5A0301C04060006F5C0301C04060006F5E0301C04060006F600301C04060006F620301C04060006F640301C04060006F660301C04060006F680301C04060006F6A0301C0

4060006F6C0301C04060006F6E0301C04060006F700301C04060006F720301C04060006F740301C04060006F760301C04060006F780301C04060006F7A0301C04060006F7C0301C04060006F7E0301C04060006F800301C04060006F820301C04060006F840301C04060006F860301C04060006F880301C04060006F8A0301C04060006F8C0301C04060006F8E0301C04060006F900301C04060006F920301C04060006F940301C04060006F960301C04060006F980301C04060006F9A0301C04060006F9C0301C04060006F9E0301C04060006FA00301C04060006FA20301C04060006FA40301C04060006FA60301C04060006FA80301C04060006FAA0301C0

4060006FAC0301C04060006FAE0301C04060006FB00301C04060006FB20301C04060006FB40301C04060006FB60301C04060006FB80301C04060006FBA0301C04060006FBC0301C04060006FBE0301C04060006FC00301C04060006FC20301C04060006FC40301C04060006FC60301C04060006FC80301C04060006FCA0301C04060006FCC0301C04060006FCE0301C04060006FD00301C04060006FD20301C04060006FD40301C04060006FD60301C04060006FD80301C04060006FDA0301C04060006FDC0301C04060006FDE0301C04060006FE00301C04060006FE20301C04060006FE40301C04060006FE60301C04060006FE80301C04060006FEA0301C0

4060006FEC0301C04060006FEE0301C04060006FF00301C04060006FF20301C04060006FF40301C04060006FF60301C04060006FF80301C04060006FFA0301C04060006FFC0301C04060006FFE0301C058E0082300A8C00060301C304010000002404000584001010071E002455FFF012C20FFFF00808058E0182300A8AA040010104B7800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

天喻2019

108401F403810100010300030B391B1923C85004E0EE09400B0E0025004E007700A000C900F2011B0A12282F2837283C2861286E289328A028D229040B040025004E4040006C000301C071E002460FFF013600FFFF0180E04060006C020301C04060006C040301C04060006C060301C04060006C080301C04060006C0A0301C04060006C0C0301C04060006C0E0301C04060006C100301C04060006C120301C04060006C140301C04060006C160301C04060006C180301C04060006C1A0301C04060006C1C0301C04060006C1E0301C04060006C200301C04060006C220301C04060006C240301C04060006C260301C04060006C280301C04060006C2A0301C0

4060006C2C0301C04060006C2E0301C04060006C300301C04060006C320301C04060006C340301C04060006C360301C04060006C380301C04060006C3A0301C04060006C3C0301C04060006C3E0301C04060006C400301C04060006C420301C04060006C440301C04060006C460301C04060006C480301C04060006C4A0301C04060006C4C0301C04060006C4E0301C04060006C500301C04060006C520301C04060006C540301C04060006C560301C04060006C580301C04060006C5A0301C04060006C5C0301C04060006C5E0301C04060006C600301C04060006C620301C04060006C640301C04060006C660301C04060006C680301C04060006C6A0301C0

4060006C6C0301C04060006C6E0301C04060006C700301C04060006C720301C04060006C740301C04060006C760301C04060006C780301C04060006C7A0301C04060006C7C0301C04060006C7E0301C04060006C800301C04060006C820301C04060006C840301C04060006C860301C04060006C880301C04060006C8A0301C04060006C8C0301C04060006C8E0301C04060006C900301C04060006C920301C04060006C940301C04060006C960301C04060006C980301C04060006C9A0301C04060006C9C0301C04060006C9E0301C04060006CA00301C04060006CA20301C04060006CA40301C04060006CA60301C04060006CA80301C04060006CAA0301C0

4060006CAC0301C04060006CAE0301C04060006CB00301C04060006CB20301C04060006CB40301C04060006CB60301C04060006CB80301C04060006CBA0301C04060006CBC0301C04060006CBE0301C04060006CC00301C04060006CC20301C04060006CC40301C04060006CC60301C04060006CC80301C04060006CCA0301C04060006CCC0301C04060006CCE0301C04060006CD00301C04060006CD20301C04060006CD40301C04060006CD60301C04060006CD80301C04060006CDA0301C04060006CDC0301C04060006CDE0301C04060006CE00301C04060006CE20301C04060006CE40301C04060006CE60301C04060006CE80301C04060006CEA0301C0

4060006CEC0301C04060006CEE0301C04060006CF00301C04060006CF20301C04060006CF40301C04060006CF60301C04060006CF80301C04060006CFA0301C04060006CFC0301C04060006CFE0301C04060006D000301C04060006D020301C04060006D040301C04060006D060301C04060006D080301C04060006D0A0301C04060006D0C0301C04060006D0E0301C04060006D100301C04060006D120301C04060006D140301C04060006D160301C04060006D180301C04060006D1A0301C04060006D1C0301C04060006D1E0301C04060006D200301C04060006D220301C04060006D240301C04060006D260301C04060006D280301C04060006D2A0301C0

4060006D2C0301C04060006D2E0301C04060006D300301C04060006D320301C04060006D340301C04060006D360301C04060006D380301C04060006D3A0301C04060006D3C0301C04060006D3E0301C04060006D400301C04060006D420301C04060006D440301C04060006D460301C04060006D480301C04060006D4A0301C04060006D4C0301C04060006D4E0301C04060006D500301C04060006D520301C04060006D540301C04060006D560301C04060006D580301C04060006D5A0301C04060006D5C0301C04060006D5E0301C04060006D600301C04060006D620301C04060006D640301C04060006D660301C04060006D680301C04060006D6A0301C0

4060006D6C0301C04060006D6E0301C04060006D700301C04060006D720301C04060006D740301C04060006D760301C04060006D780301C04060006D7A0301C04060006D7C0301C04060006D7E0301C04060006D800301C04060006D820301C04060006D840301C04060006D860301C04060006D880301C04060006D8A0301C04060006D8C0301C04060006D8E0301C04060006D900301C04060006D920301C04060006D940301C04060006D960301C04060006D980301C04060006D9A0301C04060006D9C0301C04060006D9E0301C04060006DA00301C04060006DA20301C04060006DA40301C04060006DA60301C04060006DA80301C04060006DAA0301C0

4060006DAC0301C04060006DAE0301C04060006DB00301C04060006DB20301C04060006DB40301C04060006DB60301C04060006DB80301C04060006DBA0301C04060006DBC0301C04060006DBE0301C04060006DC00301C04060006DC20301C04060006DC40301C04060006DC60301C04060006DC80301C04060006DCA0301C04060006DCC0301C04060006DCE0301C04060006DD00301C04060006DD20301C04060006DD40301C04060006DD60301C04060006DD80301C04060006DDA0301C04060006DDC0301C04060006DDE0301C04060006DE00301C04060006DE20301C04060006DE40301C04060006DE60301C04060006DE80301C04060006DEA0301C0

4060006DEC0301C04060006DEE0301C04060006DF00301C04060006DF20301C04060006DF40301C04060006DF60301C04060006DF80301C04060006DFA0301C04060006DFC0301C04060006DFE0301C04060006E000301C04060006E020301C04060006E040301C04060006E060301C04060006E080301C04060006E0A0301C04060006E0C0301C04060006E0E0301C04060006E100301C04060006E120301C04060006E140301C04060006E160301C04060006E180301C04060006E1A0301C04060006E1C0301C04060006E1E0301C04060006E200301C04060006E220301C04060006E240301C04060006E260301C04060006E280301C04060006E2A0301C0

4060006E2C0301C04060006E2E0301C04060006E300301C04060006E320301C04060006E340301C04060006E360301C04060006E380301C04060006E3A0301C04060006E3C0301C04060006E3E0301C04060006E400301C04060006E420301C04060006E440301C04060006E460301C04060006E480301C04060006E4A0301C04060006E4C0301C04060006E4E0301C04060006E500301C04060006E520301C04060006E540301C04060006E560301C04060006E580301C04060006E5A0301C04060006E5C0301C04060006E5E0301C04060006E600301C04060006E620301C04060006E640301C04060006E660301C04060006E680301C04060006E6A0301C0

4060006E6C0301C04060006E6E0301C04060006E700301C04060006E720301C04060006E740301C04060006E760301C04060006E780301C04060006E7A0301C04060006E7C0301C04060006E7E0301C04060006E800301C04060006E820301C04060006E840301C04060006E860301C04060006E880301C04060006E8A0301C04060006E8C0301C04060006E8E0301C04060006E900301C04060006E920301C04060006E940301C04060006E960301C04060006E980301C04060006E9A0301C04060006E9C0301C04060006E9E0301C04060006EA00301C04060006EA20301C04060006EA40301C04060006EA60301C04060006EA80301C04060006EAA0301C0

4060006EAC0301C04060006EAE0301C04060006EB00301C04060006EB20301C04060006EB40301C04060006EB60301C04060006EB80301C04060006EBA0301C04060006EBC0301C04060006EBE0301C04060006EC00301C04060006EC20301C04060006EC40301C04060006EC60301C04060006EC80301C04060006ECA0301C04060006ECC0301C04060006ECE0301C04060006ED00301C04060006ED20301C04060006ED40301C04060006ED60301C04060006ED80301C04060006EDA0301C04060006EDC0301C04060006EDE0301C04060006EE00301C04060006EE20301C04060006EE40301C04060006EE60301C04060006EE80301C04060006EEA0301C0

4060006EEC0301C04060006EEE0301C04060006EF00301C04060006EF20301C04060006EF40301C04060006EF60301C04060006EF80301C04060006EFA0301C04060006EFC0301C04060006EFE0301C04060006F000301C04060006F020301C04060006F040301C04060006F060301C04060006F080301C04060006F0A0301C04060006F0C0301C04060006F0E0301C04060006F100301C04060006F120301C04060006F140301C04060006F160301C04060006F180301C04060006F1A0301C04060006F1C0301C04060006F1E0301C04060006F200301C04060006F220301C04060006F240301C04060006F260301C04060006F280301C04060006F2A0301C0

4060006F2C0301C04060006F2E0301C04060006F300301C04060006F320301C04060006F340301C04060006F360301C04060006F380301C04060006F3A0301C04060006F3C0301C04060006F3E0301C04060006F400301C04060006F420301C04060006F440301C04060006F460301C04060006F480301C04060006F4A0301C04060006F4C0301C04060006F4E0301C04060006F500301C04060006F520301C04060006F540301C04060006F560301C04060006F580301C04060006F5A0301C04060006F5C0301C04060006F5E0301C04060006F600301C04060006F620301C04060006F640301C04060006F660301C04060006F680301C04060006F6A0301C0

4060006F6C0301C04060006F6E0301C04060006F700301C04060006F720301C04060006F740301C04060006F760301C04060006F780301C04060006F7A0301C04060006F7C0301C04060006F7E0301C04060006F800301C04060006F820301C04060006F840301C04060006F860301C04060006F880301C04060006F8A0301C04060006F8C0301C04060006F8E0301C04060006F900301C04060006F920301C04060006F940301C04060006F960301C04060006F980301C04060006F9A0301C04060006F9C0301C04060006F9E0301C04060006FA00301C04060006FA20301C04060006FA40301C04060006FA60301C04060006FA80301C04060006FAA0301C0

4060006FAC0301C04060006FAE0301C04060006FB00301C04060006FB20301C04060006FB40301C04060006FB60301C04060006FB80301C04060006FBA0301C04060006FBC0301C04060006FBE0301C04060006FC00301C04060006FC20301C04060006FC40301C04060006FC60301C04060006FC80301C04060006FCA0301C04060006FCC0301C04060006FCE0301C04060006FD00301C04060006FD20301C04060006FD40301C04060006FD60301C04060006FD80301C04060006FDA0301C04060006FDC0301C04060006FDE0301C04060006FE00301C04060006FE20301C04060006FE40301C04060006FE60301C04060006FE80301C04060006FEA0301C0

4060006FEC0301C04060006FEE0301C04060006FF00301C04060006FF20301C04060006FF40301C04060006FF60301C04060006FF80301C04060006FFA0301C04060006FFC0301C04060006FFE0301C058E0082300A8C00060301C304010000002404000584001010071E002455FFF012C20FFFF00808058E0182300A8AA040010104B7800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000



Cave相关的APDU

0) Run Cave
A088000011
0000000064000000000030BF4780000000
A0C0000003
030504 9000
———————
格式:
INS = 88
P1 = 00
P2 = 00
Lc = 11
Le = 03
———————-
1字节 RANDTYPE
2-5字节 RAND/RANDU内容
6字节 Digits Length(以bit为单位)
7-9字节 DIGITS
10字节 Process_Control
11-17字节 ESN
———————
00-00000064-00-000000-00-30BF4780-000000
rand type = 0 global rand
rand date = 00 00 00 64
digits length = 0
digits = 00 00 00
process control = 00 无须保存中间密钥 (供生成kvm)
10 要保存, 后面生成kvm要用到
———————-

1)Gen SSD

生成新的SSD
A08400000F
2523BCF7B5A09F0030BF4780000000
A082000003
02-0B-0C
—————–
INS = 84
P1 = 00
P2 = 00
Lc = 0F
Le = 00
——————-
1-7个字节 RANDSSD
8字节 处理控制(Process_Control)

2523BCF7B5A09F-00-30BF4780-000000

2) 确认SSD
A082000003
02A20C

3) Gen KVM

INS=8E
P1=00
P2=00
Le=02
Lc=xx

命令数据

字节1 输出 VPM 的第一个字节的偏移地址
字节2 输出 VPM 的最后一个字节的偏移地址

响应数据
1-8 密钥
9-* VPM

命令
A08E0000-02-0040
响应
7F304BAFDFEEE5844E2D9F91C321FAA88C118321E0279DFE8B5807EEA275FFCC8F1C8694959F41A91D7F35C5836A8C1A9410E99EC7514235CA8BD2D3DA435B7020599D5721BAE871009000

MMSS Location Associated Priority List (MLPL) Parameter Block

如果UICC支持多模,在 DF_TELECOM 下应该存在一个 DF_MMSS(5F3C)目录

未用到的字节 设置为FF

MLPL格式

bit位置 字段长度    字段               值    名称                      解释
1        16      0000000000011001           25      MLPL_SIZE
17       8       00000001                  1      CUR_MMSS_P_REV  
25       16      0000000000000001          1     MLPL_VER_D
41       8       00000001                  1     MLPL_ID
49       8       00000001                  1     NUM_MLPL_RECS
57       5        00000                    0     LOC_PARAM_TYPE bits7-3
62       1        1                        1     LOC_PARAM_TYPE bit 2        :::NUM_SYS_LOC_TAG指定
63       1        1                        1     LOC_PRARM_TYPE bit 1     ::MNC指定
64       1        1                        1     LOC_PRARM_TYPE bit 0     ::MCC指定
65       12     000100100011               291     MCC
77       12     111111111111               4095    MNC
89       8     00000010                     2    NUM_SYS_LOC_TAG
97       8     00000001                     1    SYS_TYPE           ::3GPP_AI
105      8     00100000                     32    SYS_LOC_TAG_SIZE      
113     24     001000011111010011111111                 PLMN_START
137      8     00000000                     0    PLMN_RANGE
145      8     00000001                     1    SYS_TYPE
153      8     00100000                     32    SYS_LOC_TAG_SIZE
161      24    001000011111010111111111                 PLMN_START
185      8     00000000                     0    PLMN_RANGE
193      8     00000001                     1    MSPL_INDEX



MLPL: 0021010008010307460FFF01012064F0FF000107455FFF01012054F5FF00010002

精简

00 13 01 00 08 01 01 07  46 0f ff 01 01 20 64 f0  ff 00 01
或者
00 15 01 00 08 01 02 07  46 0f ff 01 01 20 64 f0  ff 00 01 00 02

MLPL(天喻2019)
0021010008010307460FFF01012064F0FF000107455FFF01012054F5FF00010002FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

MSPL
001B010008020104071F000E007D001E80204071F030F8147C03EEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

CSIM初始化全过程

C.S0065-B v3.0
7.1.1 初始化

7.1.1.1 CSIM应用选择
在UICC激活后, ME选择一个CSIM应用.
如果没有EF_DIR文件 或者 在EF_DIR文件里没有CSIM应用列出, ME将尝试选择R-UIM

7.1.1.2 CSIM初始化
如果EF_ME3GPDOPC(也就是要支持3G Packet Data Simple IP或者Mobile IP服务) 文件存在, 在选择CSIM应用后, CSIM应该将EF_ME3GPDOPC的第1个字节
设置为’00’

1) ME执行紧急呼叫代码(Emergency Call Codes)请求
2) 首选 语言 (Preferred Language)
3) 执行 用户验证过程 (PIN1 PIN2), 如果此过程没有成功执行, 初始化过程终止.
4) ME执行 管理数据(Administrative Data)请求
5) 执行 CSIM Service Table 请求
6) 执行 Enable Service Table 请求 (? 新标准已经不要求这个了)
7) 执行 OTASP/OTAPA 特性请求
8) 执行 RUIMID请求
9) 执行 ESN_MEID_ME 更新
10) ME特定的配置请求
如果ME和CSIM都支持相关的服务, 还应该执行下面的过程
11) Service Preference
12) AKA(3GCIK)
13) IMSI
14) Access Overload Class information
15) PRL 和 EPRL
16) PUZL (Preferred User Zone List)
17) 3GPD Operation Capabilities 更新
18) Device Model 更新
19) Multimode Location Association Priority List(MLPL)
20) Multimode System Priority List(MSPL)
21) 读取 ME和CSIM都支持的 附加服务相关的EF
在CSIM初始化完成后, ME准备好一个CSIM的会话, 就往CSIM发送一个STATUS命令(P1=01 标识当前应用已经初始化完成)

HRPD Access Authentication Capability Parameters

如果 7F25/6F32 的第5项 服务 被设置, 那么就应该存在EF_HRPDCAP 文件
文件大小: 3字节
结构: 透明二进制

编码方法 定义在 3GPP2 C.S0016-D, Over-the-Air Service Provisioning of Mobile Stations in Spread Spectrum Systems 中

3.5.8.12 HRPD Access Authentication Capability Parameters
第1个字节 MAX_NAI_LENGHT (Maximum Access Authentication NAI length) 0x40 (建议值 >= 0x48)
第2个字节 MAX_SS_LENGHT (Maximum Length of the Shared Secret Data) 高5位有效, 低3位保留为0 0x80 (>=0x10)
第3个字节 AUTH_ALGORITHM 鉴权算法 0x80 (最高位为,表示为 CHAP模式)

————-
Network Access Identifier (NAI)
中国电信 2017的USIM中 这个文件的值是 488080, 确实是符合规范的

CSIM Service Table

7F25/6F32

FF 03 FF 33 FF FF 3C 03 00 C0 00 00
FF 03 FC 03 FF 00 FC 03 00 0C 00 00 (老sim错误)
改成
00 03 C3 00 03 00 00 00 00 C0 00 00

CHV disable function 11 (可取消)
Abbreviated Dialing Numbers(ADN) 11 (可取消)
Fixed Dialing NUmbers(FDN) 11 (可取消)
Short Message Storage(SMS) 11 (可取消)

HRPD 11
Enhanced Phone Book 00
Multi Media Domain(MMD) 00
SF_EUIMID-based EUIMID 00

MEID Support 11
Extension 1 11 (可取消)
Extension 2 11 (可取消)
SMS Parameters 11

Last Number Dialed(LND) 11 (可取消)
Service Catergory Program for BC_SMS 00
Messaging and 3GPD Extensions 11 (可取消)
Root Certificated 00

CDMA Home Service Provider Name 11
Service Dialing Numbers(SDN) 11 (可取消)
Extenssion 3 11 (可取消)
3GPD-SIP 11 (可取消)

WAP Browser 11 (可取消)
Java 11 (可取消)
Reserved for CDG 11 (可取消)
Reserved for CDG 11 (可取消)

Data Download via SMS Broadcast 00
Data Download via SMS-PP 11 (可取消)
Menu Selection 11 (可取消)
Call Control 00

Proactive R-UIM 11 (可取消)
AKA 00
IPV6 00
RFU 00

RFU 00
RFU 00
RFU 00
RFU 00

RFU 00
3GPD-MIP 00
BCMCS 00
Multimedia Message Servicde(MMS) 11

Extension 8 00
MMS User Connnectivity Parameters 00
Application Authencation 00
Group Identifer Level 1 00

Group Identified Level 2 00
De-Peronalization Control Keys 00
Cooperative Network List 00
Call Control for Mobile Originated SMS Sevice 00

7FF1/6F32
E62A049CF40000000000
改成
C0020400000000000000

Local Phone book — 0
Fixed Dialing Numbers(FDN) — 1 (可以取消)
Extension 2 — 1 (可以取消)
Service Dialing Numbers(SDN) — 0

Extension 3 — 0
Short Message Storage — 1 (可以取消)
Short Message Parameters — 1
HRPD — 1

Service Category Program for BS-SMS —0
CDMA Home Service Provider Name —1
via SMS Broadcast (for CCAT) —0
Data Download via SMS-PP (for CCAT) —1 (可以取消)

Call Control for Voice Services —0
3GPD-SIP —1 (可以取消)
3GPD-MIP —0
AKA —0

IP-based Location Service (LCS) —0
BCMCS —0
Multimedia Messaging Service(MMS) —1
Extension 8 —0

MMS User Connectivity Parameters —0
Application Authentication —0
Group Identifier Level 1 —0
Group Identifier Level 2 —-0

De-Presonalization Control Keys —0
Cooperative Network List —0
Outgoing Call Information —1 (可以取消)
Incoming Call Information —1 (可以取消)

Extension 5 —1 (可以取消)
Multimedia Storage —0
Image(EF_Img) —0
Reservred (Enable Service Table) —1 (可以取消)

Reservred (Capability Configuration Parametr) — 0
SF_EUIMID-based EUIMID — 0
Messaging and 3GPD Extensions — 1 (可以取消)
Root Certificated — 0

WAP Browser —1 (可以取消)
Java —1 (可以取消)
Reserved for CDG —1 (可以取消)
Reserved for CDG —1 (可以取消)

IPV6 —0
Call Control for Data Service —0
Call Control for Mobile Originated SMS –0
Card Supported ENVELOPE (USSD Data Download) and ENVELOPER(Call Control) for USSD