Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I am developing an application and part of signing up requires a user to sign a contract agreement of using the service.

I have been reading around the subject for a few days, and I am fairly happy with all the techniques around digitally signing a document. Some references below

Digitally Sign DATA, Not Documents [closed]

What is the difference between an electronic signature and a digital signature

The one open question I have is how can we truly validate that the data/contract that I present to the user for review is the same as the data/contract that has been signed?

For example, I could implement in my application all the hashing, and PKI required to securely sign the document/data, but what if I decided I wanted to become corrupt and alter the text that was displayed on the webpage (could do this through javascript, or supplying a different pdf to the one that needs to be signed).

I could show the user a completely different data/contract to what is required, then in the backend of my application, sign the correct data. I can then remove the malicious code. If anyone audited my software as a contract was in dispute, they would see I display the correct data/contract and therefore the questionable contract is binding.

I ultimately have control over all aspects of the signing, so really struggling to understand how anything can be more secure than taking my word as a provider that I will not alter the data/contract that is shown to the user.

So with all the security around actually signing the document, it still ultimately comes down to the trust in me as a developer to not maliciously alter the contractual agreement shown to the user.

Have I missed something in my research? Or does it truly come down to trust? In which case why bother digitally signing at all?

UPDATE Based on answer below:

I control the signing process and what i choose to display on the page. I could show a user Document A on the webpage. They click the 'sign now' button. Document B is used in backend and signed. I send user document B via email. They dispute it. They have no way of proving they saw document A as it was displayed on a webpage which I have now removed and replaced with document B. Unless a user is really savvy and hashes the webpage themselves or take a screen capture (most users wouldn't). How can they prove they agreed to document A?

UPDATE Based on accepted answer:

For anyone reading this and also struggling, the one thing I really overlooked here is that I assumed that I could be the keeper of my private key and my customers private key. In hindsight this is obviously just plane wrong. The only way to truly apply a digital signature is to allow both parties to sign with their own private key, and then provide their public key to allow validation of the signature. The problem with this is obviously that many non tech savvy users just wouldn't really know much about digital signatures and how to apply them, so I've had to admit to defeat and downgrade to plain old electronic signature with some SHA256 hashing to 'seal' it after signing.

share|improve this question
1  
Down voter please comment. What was your issue with my question? –  Gaz_Edge Jan 27 at 14:39

2 Answers 2

up vote 1 down vote accepted

Your system assumes that they are giving you access to their private key. If they are doing that, then things are already broken and the key could probably be declared as compromised and non-binding (depending on jurisdiction). A private key should always be controlled by the user who it belongs to and they should refuse to allow you to sign something on their behalf.

Instead, working properly, you would have to give them a copy of the document to sign, they would sign it themselves and provide a copy back to you. Otherwise, it is actually just you attesting that they "signed" the document and it almost certainly would not be a binding document since it is actually you signing it.

This is effectively the equivalent of you making up a document and then signing my name on it. It's a forgery and isn't binding. There may have to be a legal case about it, but it's highly likely to go in their favor.

It sounds like what you are talking about is an electronic signature rather than a digital one. You can't have cryptographic authentication of a digital signature for anyone other than the holder of the private key and only the holder of a private key can sign something. If a company is signing it on your behalf, it isn't a digital signature, but rather an electronic one. It doesn't verify it was actually you that signed it and generally has little more legal standing than clicking "I Accept" on a EULA. In many cases, in order for it to stand up in court, the company has to be able to prove that it was you who actually clicked the button and it is on them to prove the document hasn't changed. (Millage may vary by jurisdiction, and I'm not a lawyer.) This can be pretty hard to do.

share|improve this answer
    
I've seen a lot of websites where you sign a contract before using the service. I have never see one where the expectations is that the user has (or even knows) what a private key is. How do they sign the document? –  Gaz_Edge Jan 27 at 14:22
    
@Gaz_Edge Whether or not ticking a "I accept the terms and conditions" field on a webform is a legally binding contract is a legal question outside of the scope of this website. –  Philipp Jan 27 at 14:32
    
This is the difference between an electronic signature and a digital one. What they are doing there is an electronic signature. Generally, electronic signatures are much less binding since they do not provide any cryptographic authentication of the document. It's basically the equivalent of clicking "I Accept" on a EULA, though the exact legal status would vary by jurisdiction. –  AJ Henderson Jan 27 at 14:32
    
Yes i know, my question is really about digital signatures and how to in force them with a non tech savvy user (i.e. the user doesn't know what a digital signature is, what a private key is, hashing, validating files etc) I need a solution to digitally sign a document to ensure the users intent to sign can be validated without the question of my sites integrality being an issue (i.e. i don't change whats viewed to whats signed) –  Gaz_Edge Jan 27 at 14:36
    
@Gaz_Edge - it is not possible for a user to digitally sign a document if they don't understand the use of a private key. The best you could do is to have a kind of notary service that would control user's private keys for them as a trusted third party and provide the signing service, but it would still really be the notary that is signing it then unless the organization could get legal notary status. The entire point of a digital signature is that nobody other than the user can do it. As soon as you can do it for them, it's an invalid use. –  AJ Henderson Jan 27 at 14:42

If the other party to the document has any sense then they will quickly detect your nefarious behaviour. The whole point of digital signatures is that somebody can verify that the document and signature match.

Lets take an example. I am signing up to a contract on your website. You display the contract (document A) and I agree to it. You then change the terms of the document to your advantage (creating document B) and sign it. You then mail me the document for my record (I'm going to insist on this).

  • If you mail me document A then the digital signature will not match when I verify it - so my suspicions are aroused.
  • If you mail me document B then I see that the terms have changed and I challenge it.

The only way for you to send me document A and a signature that matches document B is to find a collision in the signing process, which if a proper process is followed, will be more or less impossible.

share|improve this answer
    
But i control the signing process and what i choose to display on the page. I could show you document A on the webpage. You click the 'sign now' button. Document B is used in backend and signed. I send you document B. You dispute it. You have no way of proving you saw document A as it was displayed on a webpage which I have now removed and replaced with document B. Unless a user is really savvy and hashes the webpage themselves or take a screen capture (most users wouldn't). How can they prove they agreed to document A? –  Gaz_Edge Jan 27 at 13:40
    
@Gaz_Edge I'm going to want a copy of the document before I agree to it. That's when I validate the signature. Even if I don't verify the signature I'm probably still covered by standing law - so long as I dispute document B as soon as I receive it. The law is on my side, certainly in the UK anyway. Google for cooling off period and distance selling regulations. –  Qwerky Jan 27 at 14:10
    
Is the key to my problem that the signed document is sent to them via email? Once that happens, there is no way for me to change the document. Based on the cooling off period, they can then reject this document? If they don't reject it, its assumed to be fine? –  Gaz_Edge Jan 27 at 14:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.