如何在 Android 密钥库中存储对称密钥

How to store a symmetric key in the Android Keystore

我想为我用于加密和解密的对称密钥提供安全性。 我想加密对称密钥并存储在共享首选项中。 我该怎么做?

实际上这不是一个非常可取的策略。 你不应该在你的应用程序中存储密钥,因为你不能信任交付的应用程序。

做到这一点的唯一方法是拥有一个具有用户帐户的可信服务器,该服务器使用需要保护的 api。

Collection of all reasons Reasons why google does not advice to do so, and counter measures