# A3/A8算法

**A3/A8**是GSM移动电话系统中用于用户认证（A3）和加密密钥生成（A8）的一对安全函数。在实际应用中，两者通常作为一个单一算法一起实现，一般写作A3/A8，每个GSM网络运营商都可以自由选择或开发自己的算法，而不必使用完全标准化的算法。<sup>[1](https://www.gsma.com/newsroom/wp-content/uploads/SG.03-v3.61.pdf)</sup><sup> • </sup><sup>[2](https://www.gsma.com/solutions-and-impact/technologies/security/security-algorithms/)</sup>

| 关键事实 | 详情 |
|---|---|
| 在GSM中的作用 | A3认证用户；A8派生供无线接口上A5流密码使用的加密密钥Kc<sup>[3](https://www.etsi.org/images/files/ETSIWhitePapers/etsi_wp1_security.pdf)</sup> |
| 输入 | 128位用户密钥Ki和128位随机挑战RAND<sup>[4](https://www.etsi.org/deliver/etsi_TS/155200_155299/155205/18.00.00_60/ts_155205v180000p.pdf)</sup> |
| 输出 | 32位符号响应SRES（A3）和64位加密密钥Kc（A8）<sup>[4](https://www.etsi.org/deliver/etsi_TS/155200_155299/155205/18.00.00_60/ts_155205v180000p.pdf)</sup> |
| 运行位置 | 移动侧的SIM卡；网络侧的认证中心（AuC）<sup>[2](https://www.gsma.com/solutions-and-impact/technologies/security/security-algorithms/)</sup> |
| 标准化状态 | 可由运营商指定，未完全标准化；提供了COMP128、COMP128-2、COMP128-3和GSM-MILENAGE等示例算法<sup>[1](https://www.gsma.com/newsroom/wp-content/uploads/SG.03-v3.61.pdf)</sup><sup> • </sup><sup>[4](https://www.etsi.org/deliver/etsi_TS/155200_155299/155205/18.00.00_60/ts_155205v180000p.pdf)</sup> |
| COMP128-1的已知弱点 | 将Kc的10个比特置零，使有效加密密钥缩短至54位；1998年被逆向工程并攻破<sup>[5](https://www.researchgate.net/publication/327859955_GSM_Security_Threats_And_Challenges)</sup> |
| 时间要求 | 算法A3的运行时间应小于500毫秒<sup>[6](https://www.etsi.org/deliver/etsi_ts/100900_100999/100929/08.05.00_60/ts_100929v080500p.pdf)</sup> |

## 在GSM安全中的角色

GSM使用三种安全算法：A3用于认证，A8用于加密密钥生成，A5系列用于在无线接口上加密语音和数据。A3和A8存储在[SIM卡](https://www.edgepedia.org/zh/sim-card)和网络的认证中心中，而A5在移动设备和基站子系统中运行。<sup>[3](https://www.etsi.org/images/files/ETSIWhitePapers/etsi_wp1_security.pdf)</sup>

认证通过挑战-响应机制工作。网络生成一个随机数RAND并发送给移动台。SIM卡使用A3从RAND和秘密用户密钥Ki计算出符号响应SRES，并将SRES返回给网络，网络在AuC中执行相同的计算并比较结果。由于每次挑战都是新鲜且随机的，窃听无线信道不会泄露对下一次认证有用的信息。<sup>[3](https://www.etsi.org/images/files/ETSIWhitePapers/etsi_wp1_security.pdf)</sup>

**密钥生成。** 相同的输入RAND和Ki被送入A8，由A8计算出64位加密密钥Kc。SIM卡和AuC派生出相同的Kc，因此认证之后网络可以命令启动A5加密，而无需传输密钥本身。AuC将三元组（RAND、SRES、Kc）作为认证三元组传递给拜访位置寄存器，这样呼叫的认证和加密无需再与AuC联系。<sup>[7](https://www.3gpp.org/ftp/tsg_sa/wg3_security/tsgs3_33_beijing/docs/pdf/S3-040360.pdf)</sup><sup> • </sup><sup>[8](https://www2.imm.dtu.dk/pubdb/edoc/imm6812.pdf)</sup> 由于实际加密密钥的最大长度由GSM谅解备忘录固定，A8必须将实际密钥（如果较短）扩展为64位字，并将低位中不属于实际密钥的各位置零。<sup>[6](https://www.etsi.org/deliver/etsi_ts/100900_100999/100929/08.05.00_60/ts_100929v080500p.pdf)</sup>

## 运营商选择与示例算法

GSM规范仅对A3和A8给出外部要求；算法本身被视为各个公共陆地移动网络运营商自己的事务。一个可能算法的提案由GSM/MoU管理，可应要求提供。<sup>[6](https://www.etsi.org/deliver/etsi_ts/100900_100999/100929/08.05.00_60/ts_100929v080500p.pdf)</sup> 对于不想自行设计算法的运营商，GSM协会提供了COMP128系列示例算法，其规范在受控规则下分发。<sup>[1](https://www.gsma.com/newsroom/wp-content/uploads/SG.03-v3.61.pdf)</sup>

COMP128系列有三个成员。COMP128（也称COMP128-1）是最初的参考实现，被许多运营商同时用于A3和A8，在一次运行中生成SRES和Kc。COMP128-2和COMP128-3是为解决其安全问题而开发的；COMP128-3消除了Kc中10个比特被置零的弱点。运营商已从COMP128-1迁移到后续版本，这一变更需要更换SIM卡，因为算法存储在其中。<sup>[5](https://www.researchgate.net/publication/327859955_GSM_Security_Threats_And_Challenges)</sup><sup> • </sup><sup>[9](https://www.researchgate.net/publication/234815475_Cell_phone_cloning_a_perspective_on_GSM_security)</sup> 根据ETSI的一份设计标准报告，COMP128于1998年被攻破，自1999年初起被另一个GSM协会示例算法所取代。<sup>[10](https://www.etsi.org/deliver/etsi_tr/133900_133999/133901/04.00.00_60/tr_133901v040000p.pdf)</sup>

一个完全公开的替代方案是GSM-MILENAGE，在3GPP TS 55.205中作为A3和A8功能的示例算法集进行了规定。它复用了UMTS MILENAGE算法集，不是强制性的，可免费下载。<sup>[4](https://www.etsi.org/deliver/etsi_TS/155200_155299/155205/18.00.00_60/ts_155205v180000p.pdf)</sup><sup> • </sup><sup>[2](https://www.gsma.com/solutions-and-impact/technologies/security/security-algorithms/)</sup>

## 密码分析历史

COMP128曾被保密，但1998年被Marc Briceno、Ian Goldberg和David Wagner逆向工程，他们还演示了一种选择挑战攻击，利用压缩函数中的碰撞，在获得SIM卡访问权限的情况下恢复出秘密密钥Ki。<sup>[5](https://www.researchgate.net/publication/327859955_GSM_Security_Threats_And_Challenges)</sup><sup> • </sup><sup>[11](https://www.researchgate.net/publication/2362492_Reducing_the_Collision_Probability_of_Alleged_Comp128)</sup> 后来的演示在12小时内用约15万个挑战恢复了Ki，研究人员指出即使是空中接口版本的攻击也可能是可行的。<sup>[12](https://itooktheredpill.irgendwo.org/stuff/studium/gsm.pdf)</sup>

**划分攻击。** 2002年，IBM研究人员提出了一类称为划分攻击的侧信道攻击，并将其用于针对不同SIM卡类型上的多种COMP128实现，最少仅用8个选择明文就恢复了128位密钥。<sup>[13](https://research.ibm.com/publications/partitioning-attacks-or-how-to-rapidly-clone-some-gsm-cards)</sup>

**54位密钥。** 当COMP128于1998年公开时，人们发现它为Kc生成的64个比特中有10个始终为零，使有效加密密钥缩短至54位，无论使用哪种A5密码，密钥空间都缩小了1024倍。COMP128-2中也存在同样的削弱；COMP128-3消除了它。<sup>[9](https://www.researchgate.net/publication/234815475_Cell_phone_cloning_a_perspective_on_GSM_security)</sup><sup> • </sup><sup>[14](https://citeseerx.ist.psu.edu/document?doi=b0c8493e0c6b6e5e08d870a1b318401236e07e82&repid=rep1&type=pdf)</sup> 爱立信对该算法历史的记述将这一点归因于为符合出口管制要求所作的调整：密钥生成算法COMP128-1和COMP128-2通过将密钥的10个比特置零，将有效输出密钥长度降至54位，而COMP128-1现在被禁止在网络和SIM卡中支持。<sup>[15](https://www.ericsson.com/en/blog/2021/6/evolution-of-cryptographic-algorithms)</sup>

## GSM语音之外的用途

A3/A8功能比电路交换电话存活得更久。EAP-SIM协议（RFC 4186）复用了在SIM卡上运行的A3/A8算法进行网络认证，将128位RAND送入SIM卡并接收SRES和Kc。由于GSM认证不提供双向认证，且单个64位Kc对数据网络来说太弱，EAP-SIM将多个RAND挑战及其Kc值组合成更强的密钥材料。<sup>[16](https://www.rfc-editor.org/info/rfc4186/)</sup> 铱星卫星系统同样以GSM为模型设计其认证，并依赖COMP128系列来实现A3和A8功能。<sup>[17](https://www.researchgate.net/publication/401910657_Systematic_Security_Analysis_of_the_Iridium_Satellite_Radio_Link)</sup>

## References

1. [GSM Association, Official Document SG.03: Rules for the Management and Distribution of the COMP128 Family of Example A3 and A8 Algorithms](https://www.gsma.com/newsroom/wp-content/uploads/SG.03-v3.61.pdf)
2. [GSMA Security Algorithms page](https://www.gsma.com/solutions-and-impact/technologies/security/security-algorithms/)
3. [ETSI White Paper No. 1: Security for ICT](https://www.etsi.org/images/files/ETSIWhitePapers/etsi_wp1_security.pdf)
4. [ETSI TS 155 205 V18.0.0: Specification of the GSM-MILENAGE Algorithms (3GPP TS 55.205)](https://www.etsi.org/deliver/etsi_TS/155200_155299/155205/18.00.00_60/ts_155205v180000p.pdf)
5. [GSM Security: Threats and Challenges (ResearchGate)](https://www.researchgate.net/publication/327859955_GSM_Security_Threats_And_Challenges)
6. [ETSI TS 100 929 V8.5.0 (3GPP TS 03.20 v8.5.0): Security-related network functions](https://www.etsi.org/deliver/etsi_ts/100900_100999/100929/08.05.00_60/ts_100929v080500p.pdf)
7. [3GPP S3-040360: GSM Authentication Protocol contribution](https://www.3gpp.org/ftp/tsg_sa/wg3_security/tsgs3_33_beijing/docs/pdf/S3-040360.pdf)
8. [Virtual SIM thesis, DTU](https://www2.imm.dtu.dk/pubdb/edoc/imm6812.pdf)
9. [Cell phone cloning: a perspective on GSM security (ResearchGate)](https://www.researchgate.net/publication/234815475_Cell_phone_cloning_a_perspective_on_GSM_security)
10. [ETSI TR 133 901 V4.0.0: Criteria for cryptographic algorithm design process](https://www.etsi.org/deliver/etsi_tr/133900_133999/133901/04.00.00_60/tr_133901v040000p.pdf)
11. [Handschuh et al., Reducing the Collision Probability of Alleged Comp128 (ResearchGate)](https://www.researchgate.net/publication/2362492_Reducing_the_Collision_Probability_of_Alleged_Comp128)
12. [Cryptography in GSM (student paper)](https://itooktheredpill.irgendwo.org/stuff/studium/gsm.pdf)
13. [IBM Research: Partitioning attacks, or how to rapidly clone some GSM cards (S&P 2002)](https://research.ibm.com/publications/partitioning-attacks-or-how-to-rapidly-clone-some-gsm-cards)
14. [Security in the GSM system (CiteSeerX)](https://citeseerx.ist.psu.edu/document?doi=b0c8493e0c6b6e5e08d870a1b318401236e07e82&repid=rep1&type=pdf)
15. [Ericsson blog: The evolution of cryptographic algorithms](https://www.ericsson.com/en/blog/2021/6/evolution-of-cryptographic-algorithms)
16. [RFC 4186: EAP Method for GSM Subscriber Identity Modules (EAP-SIM)](https://www.rfc-editor.org/info/rfc4186/)
17. [Systematic Security Analysis of the Iridium Satellite Radio Link (ResearchGate)](https://www.researchgate.net/publication/401910657_Systematic_Security_Analysis_of_the_Iridium_Satellite_Radio_Link)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 通信与日常技术 › 电话系统与服务 › Mobile and precellular telephony › Early cellular standards › GSM (telephony standard)

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/a3-a8-algorithm

English original: https://www.edgepedia.org/a3-a8-algorithm
