I want to create a piece of software that will hold some information, the program works offline and I want to make sure that information can't be tampered with. The program can create or alter it's information at any point.

I thought about having the program create and hold it's own key pair and sign the information, but is this reasonable? I'm scared that a user could find the private key of the program and fake the information. How could this be avoided?

Thank you.

1 Answer 1


No, tamper-resistant applications implemented purely in software are unfortunately impossible.

Software which runs on the user's machine is under the user's control. The user can extract any secret keys from the program, either from memory at runtime or from the program's binary code. A program and/or the data it uses can not be effectively encrypted, because in order to be executed and accessed it needs to be decrypted, and that decryption key and the decryption algorithm must be available in unencrypted form.

There are obfuscators which make a program harder to decipher, but those only slow down a determined attacker. They can not stop one completely.

In order to do trusted computing you need trusted hardware. There are hardware solutions available for some use-cases, like USB dongles which can hold cryptographic keys which they don't expose to the host device and can perform cryptographic operations in a black-box manner. These devices are usually quite resistant to software tampering, but they might still be susceptible to physical hardware tampering.

Also, whatever data they receive or send back to the host-system can be intercepted. When you want data to stay secret, it must not leave the trusted device.

You are unfortunately not writing enough about your exact use-case to make a guess if that would be an option in your situation and what pitfalls you could possibly step into.

  • 1
    History also shows that such hardware devices ends up being bypassed or cracked. Maybe the user can patch out the relevant code section, or replace the public key the application uses for authenticating data with their own key. I'm not aware of a single functioning DRM scheme.
    – vidarlo
    Oct 16, 2017 at 20:05
  • Hardware-based root of trust using modern TPM devices are a possibility in this area.
    – Andrew
    Mar 13, 2019 at 9:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .