加密一个字符串并使其安全,即使 apk 被提取

Encrypt A String and make it secure even apk is extracted

我想以加密形式保存一个唯一的字符串作为变量并在每个请求中将该变量作为参数传递给我的PHP服务器,这样我就可以确定该请求来自我的 android 应用程序,而不是来自其他浏览器..

即使我的 apk 被提取或成为逆向工程的受害者,我也不希望其他人知道我的字符串。 有没有办法像那样以加密形式存储变量。

如果您提到使用 PHP 解密相同变量的过程,将会很有帮助。 提前致谢..

Encrypt A String and secure even apk is extracted

完成标题中问题的唯一方法是使用非对称加密(即 crypto_box_seal,这会阻止 Android 设备解密它)。

so that I can be sure that the request is coming from my android application not from other browsers.

不可能。任何人都可以创建模拟您的 APK 的客户端。