Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Many applications need to handle sensitive data either in memory or on disk. If this sensitive data is not protected properly, it might lead to loss of secrecy or integrity of the data. It is very difficult (or expensive) to completely secure all the sensitive data. Users tend to use same passwords everywhere. So, even if your program is a simple game which stores user's profile information and requires user to enter a password, the user might choose the same password he uses for his online bank account for your game program! Now user's bank account is only as much secure as your program chooses it to be.
There are simple steps in which you can secure sensitive data in your program:

Prefer system's authentication dialog (or any other mechanism

...

provided by OS) for authentication to privileged services

If you are accessing some privileged service already installed on the system, most likely that service will have some mechanism to take password from the user. Before asking the user directly for username and password from your application, check if that service itself authenticates the user in some way. Let that service handle the authentication as it would atleast not increase footprint of the sensitive data.

...