AES-GCM (Android API 級別 <= 19)
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
- 受影響的版本
- Tink Android、所有版本
- 受影響的金鑰類型
- AES-GCM
說明
在沒有 Google Play 服務的 Android KitKat (API 級別 19) 中,AES-GCM
無法正常運作。這是因為 KitKat 使用 Bouncy Castle 1.48,而不支援 updateAAD
。
如果有 Google Play 服務,AES-GCM
應可正常運作。
如果想支援所有 Android 版本,而不依附於 Google Play 服務,請為 AEAD 使用 CHACHA20-POLY1305
、AES-EAX
或 AES-CTR-HMAC-AEAD
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eAES-GCM encryption may not function correctly on Android KitKat (API level 19) devices without Google Play Services due to limitations in Bouncy Castle 1.48.\u003c/p\u003e\n"],["\u003cp\u003eIf Google Play Services is available on the device, AES-GCM encryption should operate as expected.\u003c/p\u003e\n"],["\u003cp\u003eTo ensure compatibility across all Android versions without relying on Google Play Services, it is recommended to utilize CHACHA20-POLY1305, AES-EAX, or AES-CTR-HMAC-AEAD for authenticated encryption.\u003c/p\u003e\n"],["\u003cp\u003eThis issue impacts all versions of Tink for Android and specifically affects the AES-GCM key type.\u003c/p\u003e\n"]]],["Android KitKat without Google Play Services has a known issue where AES-GCM encryption does not function correctly due to an outdated Bouncy Castle version lacking `updateAAD` support. If Google Play Services is available, AES-GCM functions as expected. For universal Android support without Play Services dependency, utilize CHACHA20-POLY1305, AES-EAX, or AES-CTR-HMAC-AEAD instead of AES-GCM. This affects all versions of Tink Android.\n"],null,["# AES-GCM (Android API Level <= 19)\n\nAffected Versions\n: Tink Android, All Versions\n\nAffected Key Types\n: AES-GCM\n\nDescription\n-----------\n\nOn Android KitKat (API level 19) without [Google Play Services](https://developers.google.com/android/guides/overview), `AES-GCM`\ndoes not work properly. This is because KitKat uses Bouncy Castle 1.48 which\ndoes not support `updateAAD`.\n\nIf Google Play Services is present, `AES-GCM` should work well.\n\nIf you want to support all Android versions without depending on Google Play\nServices, use `CHACHA20-POLY1305`, `AES-EAX`, or `AES-CTR-HMAC-AEAD` for your\nAEAD."]]