AES-GCM (poziom API Android = 19)
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
- Wersje, których to dotyczy
- Tink Android, wszystkie wersje
- Typy kluczy, których to dotyczy
- AES-GCM
Opis
Na Androidzie KitKat (poziom interfejsu API 19) bez Usług Google Play AES-GCM
nie działa prawidłowo. Dzieje się tak, ponieważ KitKat używa Bouncy Castle 1.48, który nie obsługuje updateAAD
.
Jeśli na koncie znajdują się Usługi Google Play, usługa AES-GCM
powinna działać prawidłowo.
Jeśli chcesz obsługiwać wszystkie wersje Androida bez określonych Usług Google Play, użyj CHACHA20-POLY1305
, AES-EAX
lub AES-CTR-HMAC-AEAD
na potrzeby AEAD.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[[["\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."]]