在android中存储RSA密钥对
我想编写一个使用 RSA 加密/解密字符串的应用程序。我之前使用 openssl 创建了 RSA 密钥对并将其转换为 DER。现在,我希望从我的 Android 应用程序中读取这些密钥:
我应该将它们存储在哪里?
谢谢你,
I want to write an application that encrypts/decrypts strings with RSA. I have previously created the RSA key pair with openssl and converted it to DER. Now, I want this keys to be read from my android application:
Where I am supposed to store them?
Thank you,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的应用程序可以将状态存储在两个地方:SD 卡;以及应用程序自己的私有存储。
SD 卡是完全公开的,每个人都可以访问(和修改)那里的文件。
您的应用程序的私有数据目录应该是安全的,因为只有您的应用程序(以及您的应用程序信任的其他应用程序)才能访问它,但实际上,如果手机已root,则将文件复制出来很简单它的。
请参阅 Context 用于访问您的私人数据目录。
Your application can store state in two places: the SD card; and the application's own private storage.
The SD card is completely public and everyone can access (and modify) the files there.
Your application's private data directory is supposed to be secure, in that only your application (and other apps that your application trusts) can access it, but in practice if the phone's been rooted it's trivial to copy files out of it.
See the openFile*() and openOrCreateDatabase() methods in the documentation for Context for access to your private data directory.