保护 Android 应用程序的安全

发布于 2024-12-03 19:39:19 字数 298 浏览 0 评论 0原文

我已经“保护”了我的 Android 应用程序和提供金融交易服务的 tls 服务器之间的通信,目前正在开发中。

安全凭证存储在 Android apk 中包含的 BKS 密钥库中。密钥库的密码在应用程序源中以纯文本形式可见:

keyStore.load(is, "passwd".toCharArray());

我担心,如果有人对应用程序进行逆向工程,他们将能够冒充其他用户并危及服务的安全性。

我想知道我的实施是否存在错误,是否有其他人有这种担忧,以及防止这种可能性的最佳方法是什么。

I have 'secured' the communication between my android application and a tls server providing a financial transaction service, currently in development.

The security credentials are stored in a BKS keystore included in the Android apk. The password to the keystore is visible in plain text in the application source:


keyStore.load(is, "passwd".toCharArray());

I am concerned that if someone was to reverse engineer the app, they would be able to impersonate another user and compromise the security of the service.

I was wondering whether there is a fault in my implementation, if anyone else has this concern, and what the best method of securing against this possibility is.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

雨后咖啡店 2024-12-10 19:39:19

每当您将安全数据存储在客户端上时,它都可能会受到逆向工程的影响。您可能会尝试在代码中掩盖它,但坚定的黑客无论如何都会发现它。因此,使其更安全的唯一方法就是不要在代码中公开密码。也许您可以在应用程序启动时询问用户一些 pin 码并使用它来解密密码?

Whenever you store security data on the client it can be compromised by reverse engineering. You may try to obscure it in the code but determined hacker will figure it anyway. So the only way to make it more secure is not to have the password openly in the code. May be you can just ask user for some pin code at the start of the application and use it to decrypt the password?

鸠书 2024-12-10 19:39:19

您的应用程序中存储的凭据是否对每个用户都是唯一的,即每个用户都会获得具有唯一凭据的自己的 apk?如果您只有一个具有相同凭据的 apk,那么这与没有安全性一样好。更糟糕的是,它给人一种虚假的安全感。

您(您的雇主)确实应该聘请安全专家从安全角度设计您的系统。

这就是我要做的:

  1. 应用程序没有安全凭证。
  2. 每个用户都会在服务器上生成安全凭证。
  3. 每个用户都会获得秘密激活码,该激活码在安全环境中生成并通过替代渠道传递。最好通过普通邮件。激活码有时间限制,只能使用一次。
  4. 首次使用时,用户在应用程序中输入激活码,该激活码可以通过安全 (https) 通道一次性下载凭证。
  5. 用户提供密码来加密存储在设备上的凭据。
  6. 每次使用该应用程序时,用户都必须提供此密码。如果应用一段时间未使用,则应用必须使会话超时,并在用户想要访问时再次要求输入密码。

但不要把我的话当成理所当然。如果涉及金融交易,您仍然需要安全专家。

Are credentials stored in your app unique per user, i.e. every user gets it own apk with unique credentials? If you only have one apk with same credentials then this is as good as no security. Even worse, it gives false feeling of security.

You (your employer) should really hire a security expert to design your system from security point of view.

Here's what I'd do:

  1. App comes without security credentials.
  2. Every user is generated security credentials on server.
  3. Every user gets secret activation code which is generated in secure environment and delivered via alternative channel. Preferably via snail mail. Activation codes are time-limited and can be used only one time.
  4. On first use user types into app the activation code which enables a one-time download of credentials over a secure (https) channel.
  5. User provides password to encrypt the credentials while stored on device.
  6. Every time the app is used user must provide this paswword. If app is not used for some time the app must timeout the session and ask for password again when user wants access.

But don't take my word for granted. You still need a security expert if there are financial transactions involved.

断舍离 2024-12-10 19:39:19

我相信 Diffie-Hellman Key Exchange 正是我所寻找的。我不想使用涉及用户的复杂过程来重新实现我自己的 DH 版本。

I believe that Diffie-Hellman Key Exchange is what I was looking for. I'd rather not have to re-implement my own version of DH using a complicated process which involves the user.

以酷 2024-12-10 19:39:19

目前正在为一家处理公司进行编程 -

它们是交易应用程序的一套规则和规定 - 或者 - POS APP(销售点应用程序),

规则在线列出为 PCI 验证,必须发行一定量的安全性或这将是 Visa,inc 或许多其他公司的诉讼。

关于您的问题,它不符合 PCI 合规性,因为这是一个安全问题。

请阅读 PCI 合规性,以便完全了解安全性,损害持卡人数据是不好的。

:)

currently programming for a Processing company-

their are a set of rules and regulations for a transaction application -OR- a POS APP(Point Of Sale application)

the rules are listed online as PCI validation, a certain amount of security has to be issued or it will be a law suit from Visa,inc or Many other Company's.

about your Question, it doesn't follow PCI compliance as that is a security issue.

please read the PCI compliance so that their is a complete understanding of Security, its not good to compromise Cardholder Data.

:)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文