几周以来我一直在阅读一页又一页,但找不到解决方案。
我只想“只”:
- 制作我自己的公钥和私钥来加密和解密我的 PHP 网站和 Android 应用程序之间的字符串(例如 http://www.example-code.com/android/rsa_generateKey.asp 但如何存储和使用生成的密钥?)
- 加密我的应用程序上的字符串
- 解密来自我网站的字符串
- 加密我网站上的字符串
- 从我的应用程序中解密字符串
我刚刚找到了一个简单执行此工作的类( http://www.example-code.com/android/rsa_encryptStrings.asp ),但它不是免费的,为了使其在 PHP 上工作,我应该安装一个 PHP 扩展,但我可以' t 在我的虚拟主机上。
有类似的东西吗?我学习了很多,但我不知道为什么我不明白如何以不同的方式去做。
可能类似于
RSA Android Encrypt / RSA PHP Decrypt
的东西可能会有所帮助,但它不是完整的源代码。
请给我一些实际的工作示例。
I'm reading pages and pages since weeks but I cannot find a solution.
I want "only" to:
- Make my own public and private keys to encrypt and decrypt strings between my PHP website and Android application (like on http://www.example-code.com/android/rsa_generateKey.asp but how can I store and use the generated keys?)
- Encrypt a string on my application
- Decrypt the string from my website
- Encrypt a string on my website
- Decrypt the string from my application
I've just found a class that does simply this job ( http://www.example-code.com/android/rsa_encryptStrings.asp ) but it is not free, and to make it work on PHP I should install a PHP extension but I can't on my web hosting.
Is there something similar? I'm studying a lot but I don't know why I don't understand how to do it in different ways.
Probably something similar to
RSA Android Encrypt / RSA PHP Decrypt
could help but it is not the complete source code.
Please give me some real working examples.
发布评论
评论(1)
这应该可以做到。
http://www.javamex.com/tutorials/cryptography/rsa_encryption_2.shtml
这不是android的问题,更多的是Java的问题。
this should do it.
http://www.javamex.com/tutorials/cryptography/rsa_encryption.shtml
http://www.javamex.com/tutorials/cryptography/rsa_encryption_2.shtml
It's not an android question, much more Java.