I'm writing a .NET desktop application that is used to send orders to a server via a REST API. To avoid leaking of our authentication token I have made it so that, when used for the first time, the user has to submit the authentication token and a password to encrypt it with.
The encryption algorithm is AES-256-CBC and the scheme is as follows: the password is hashed before it's used by the algorithm, the salt used for hashing is the computer GUID so just copying the program files will not suffice, and the IV is randomly generated and concatenated with the cipher. When the user opens the program thereafter, he or she is asked for a password, decryption is started, and when the authentication token does not match the required mask it will return an error. So far so good I'd say.
However, my supervisor is not yet content with the level of security: he wants the program to log all orders that have been sent to the server in case of administrative anomalies by the third party that hosts the server, just so that we have a reference with a reasonable level of credibility (though I suppose you could just call it 'proof' in case their administration fails). The 'credibility' part is where any straightforward implementation of a logfile goes right out the window, it wouldn't provide:
- Integrity: No person (including the user) is allowed to modify the logfile with content that does not reflect actual usage of the program. The log can only be appended, only when the program's main function is used, and only by the program itself.
- Confidentiality: The contents of the log can only be summoned by the user of the program (the password prompt will aid in identification of the user).
I've tried to come up with a cryptographic scheme (digital signing) encrypting every record that is appended to the log and encrypt the public key with the user's password, but this doesn't solve half the problem: the private key would have to be stored by the program anyhow, so strictly speaking it means the user has access to it and have the ability to modify the log.
Is there a method or scheme that meets these requirements?