770 points · by linschn · 6y ago · 186 comments
For a one-liner, if you use any tool to generate a realistic version of your signature, or do what I do and actually scan a version of your signature once, and then have that as a PNG that you can drop on any PDF of your liking, here's a line to make it look nice and "scanned":
convert "$1" -alpha Off -density 150 -colorspace gray -blur 0.5x0.5 -rotate 0.4 -level 40%,60% "scanned-$1"
Or for even more noise and poor quality: convert "$1" -colorspace gray \( +clone -blur 0x1 \) +swap -compose divide -composite -linear-stretch 5%x0% -rotate 1.5 scanned-$1.pdfhttps://gist.github.com/andyrbell/25c8632e15d17c83a54602f6ac...
The OP also uses a few other flags like `+noise Gaussian` and `-attenuate 0.25` which you could toss in. Same concept, just wanted to share a one-liner you can use if you already have a PDF with a signature on it, and you need that nice "scanned" look.
Checking if a PDF file has been digitally signed, how many signatures are there and if the signatures are all valid is not an easy task! Actually, I only know how to do it in java using bounty castle. To help non-java apps with this I've implemented a small java application that provides a REST (and form) api for uploading a signed PDF file and returning information about the signatures.
It works in my organization for more than 3 years and it's has saved us from hundreds of erroneously signed PDF files! I've open sourced it for anybody having similar requirements: https://github.com/spapas/pdf-sign-check.
Parsing a PDF file is in that list that nobody wants to write themselves. Next to writing a YAML parser.
"For bureaucratic reasons, a colleague of mine had to print, sign, scan and send by email a high number of pages. To save trees, ink, time, and to stick it to the bureaucrats, I wrote this script."
So yes, it does seem like there are situations where a "digital" signature is insufficient.
As I had opened account with them years back, I couldn’t recollect what I had signed then. The clerk at the desk helpfully turned her display for me to take a quick glance at the signature in the file which I copied in the form. Thanked her well.
Dropbox's "Scan Document" feature is great for getting around that. It turns a photo into what looks exactly like a scan. I just sign the document in Preview, and then use the Scan Document feature to just "scan" the document as its displayed on my screen. The result seems indistinguishable from a printed wet ink copy also scanned with Dropbox.
I can set up Apple Pay and use it across devices to make payments worth tens of thousands, but I can’t use the same technology to authenticate a document.
It really boils the blood.
I have a previously-scanned signature that I'd like to re-use. I'd love to simply import the file. Instead I have to print it out and then hold it in front of the camera, trying to get it aligned. It's madness. Is it supposed to be more secure for some reason?
Also, I like rasterized contracts / text, instead of a small pdf + an image, as it's easier to tamper with
I used Preview for the longest time before they questioned 1 of the documents.
This project basically allows you to forge your own signature. Is it still legally binding? Do these rules even remember the original intent?
I've always thought that as long as you can recognize your own signature and declare in a court of law, under oath, that the signature is or is not yours then it's fine.
It's still not foolproof though. An ex of my GF forged her signature and took out a loan in her name. They're still on her ass about that one, despite her claims that the signature isn't hers. They're not taking it to court though, they probably don't have a case. Doesn't stop them from harassing though.
You seem to be of the opinion that since it is possible to forge a signature, it cannot be legally binding.
You are describing bureaucracy.
There are plenty of people who work (and live) by rules that no longer make sense, but hey, they're the rules!
But there's still a delta of time during which old rules continue to be applied in a manner that can feel senseless, while new processes are figured out. :-)
A signature is somewhat harder to take them and checking a checkbox and can be somewhat more easily traced back to the signatory, so it’s probably somewhat better than a checkbox.
* TOS - a simple checkbox - or even just a "continue button" * Moderately large purchase - type your name * Larger purchase - draw your name * Major contract - use this widely recognized signature flow
On the other hand, you would be right in thinking that there is a somewhat anachronistic element of theater in having signatures on electronic documents.
Not in the EU country I live in.
1. We have digital signatures we can use to sign documents and they are legally binding for gov. organizations and optionally every organization that accepts em.
2. For internal documents, metadata is sufficient after organization issues an order.
3. Between orgs, metadata is sufficient if you address that within contract.
At least I remember it being that way few years ago.
This pdf viewable signature stuff is void. Only to make feel some people better.
Though I am not a lawyer.
It's also worth noting that digital signatures throughout the european union have legal status.
Until society catches up and uses cryptographic primitives provided by a national ID smart card (such that Estonia has) for authorizing intents, this is a satisfactory method to make document execution less painful.
This project is already doing the easy part (“place pretty signature picture here”). Depending on your jurisdiction and their tolerance, you could also render a true crypto signature in ascii-armored format to assist in proving legitimacy (perhaps generated as a small print signature line under the signature).
Sidenote: Some transactions require a "wet" signature (as in, actual ink on actual paper from an actual pen). This doesn't get around those transactions unfortunately.
National ID systems are an incredibly bad idea. You can already get the entire authentication benefit from using decentralized ID systems (your bank authenticates you with your bank card, your employer authenticates you with your employee ID), so all a national ID adds is the ability for corporations to correlate all your different identities without your knowledge or consent, which is nothing but a privacy-invasive misfeature. Note that without a centralized ID they could still do it with your knowledge and consent by having you authenticate using multiple decentralized IDs.
Centralized identity is also a huge single point of failure and compromise. It would attract far higher resources from attackers than non-monoculture ID systems do, have far reaching consequences when vulnerabilities are discovered, and take far longer to respond when changes are necessary because of the scope of use.
This article is about digital signatures as in digital pictures of a signature. There's some support of them in, for example, some PDF tools. These do not have a legal status in EU.
And there are "digital signatures" as in cryptographic digital verification of documents using private/public key cryptography. This is the type of digital signatures for which EU has a legal status, and in many countries a support for verifying identity - for example, I can cryptographically sign documents using the chip on my gov't ID card, and if I receive such a document, then I can securely verify the identity of the signer without needing any preexisting relationship with them. But this has nothing to do with the pictures of signatures that this article is talking about, that seems to be more like a USA thing.
> A signature may be made (i) manually or by means of a device or machine, and (ii) by the use of any name, including a trade or assumed name, or by a word, mark, or symbol executed or adopted by a person with present intention to authenticate a writing.
IANAL but I would think that this program would fall under "by means of a device" and thus be considered valid.
Crytographic protocols can be added to verify signing, but until every civilian practices perfect opsec (never gonna happen), in-person signatures in front of a notary will always be the way business is done.
Better technology (this program, Photoshop, deepfakes, quantum prime factorization) may actually increase the need for in-person wet signatures.
IIRC, the basic construction is you generate a lattice trapdoor matrix R, such that A*(Rt + e) ~= t. Finding an input p with small coefficients, for some t such that Ap = t reduces to one of lattice reduction problems, since it requires a finding "good" basis for the lattice (if you invert A you'll have huge coefficients, so you can't forge it. Having the trapdoor R to make p = Rt + e lets you use the trapdoor to find the preimage, and the gaussian vector e smudges it so that an attacker can't collect signatures to decipher R (this is learning with errors, another problem that reduces to lattice basis.) So the signature is easy to verify, and the trapdoor matrix is relatively small and efficient to compute (iirc a couple megs and <1s)
Disclaimer: not a cryptographer, just a hobbyist.
as a side note: every time i get a new passport or id card i get told that my signature is not ok as it is (apparently not enough recognizable characters) but when confronted with the question how they would like me to change my signature as seen on all previous documents signed by me they shut up. I think its funny because it probably makes it even more unique.
Unless it's a master forger. I could look at the document and figure out that the signature wasn't mine.
This is legally binding the same way clicking the "Buy" button on Amazon is.
I've encountered this before myself, and so have many other people, and we're all already aware of what you're saying.
This is kind of useful though, I was in shock and horror when I realized one PDF my Adobe Fill & Sign app couldnt... fill and sign, an actual IRS tax form. I don't know why they let you fill most of it out but force you to sign the damn thing. What's even more confusing is other forms don't restrict this, it's just one of the ones I tried (can't remember which one but it was a while ago).
Then I take pride in outputting the cleaniest PDF possible. Never received any complaint. Most people on the receiving end probably print them out, and they appreciate the clean result, compared to what you get when you re-scan it (or intentionally blur it).
That said, for 27 pages (!!) that tool would prove a lifesaver.
Ridiculous.
One thing I did think about, though, is the legal aspect. Fraud is a serious crime and I wonder if such a thing, however silly, might just be considered fraud. In that case it might not be worth fighting the bureaucracy.
I feel that pain. When your only tool is bureaucracy everything looks like a nail. Or something like that.
I once had what I think was a document for a mortgage application refused because I'd printed it, signed it and took a photo on my phone to email back. Apparently it had to be done with a scanner and a camera was unacceptable.
I didn't have a scanner, so I chanced my arm, desaturated and thresholded the image then resubmitted it. I was thanked and it was accepted.
I actually wrote about the laborious effort to create a pseudo 'false document' by manually using Gimp on my blog; I wrote a very naive back-of-a-napkin pseudo algorithm... I was actually thinking about learning Gimp's Script-Fu to generate the signature with the Ink Tool.
In my country, to leave your home to do shopping in this period, you are required by military ordnance to fill a form stating the reason of leaving your home. You can show it on your mobile phone, but you have to print it, sign by hand and take a picture of it.
Does it support multipage pdf documents and doing multiple signatures per document?
Related to this, perhaps a UI for marking all the spots where signatures are required would make this tool extremely powerful!
The ui is going to be a lot more complicated to code. Maybe I'll give it a try someday.
Will try on other less official stuff though ha
I've been doing this manually by adding my signature in GIMP and taking a photo of my laptop screen.
Their security implementation or the authenticity mechanism they have for recording is not even really up for scrutiny, so long as they can provide some kind of proof that the signing occurred and that the counterparty signed with an understanding that the electronic signature was the same as a real signature.
I strongly suspect there are many thousands of cases in which a contract that was signed via them was simply treated as legitimate by both parties, though.
Adding some known pattern to the signature that can be recognized later in the print would be nice if you need to prove that it was not actually signed by you. But if you get to this point it is already a big mess...
More of these in "Signature_example.pdf".
In my opinion, this is a bit childish. But on the other hand, the whole scan-and-sign procedure is also a bit childish if you ask me.
But that's a narrow circumstance.
Assuming the "standard path" in the US the pieces of your ID are your birth record, any court ordered name changes (like if you got married), your social security card, and a previous cert that ties the name to a photo.
I know it's pedantic but god damn it's annoying as hell that a passport doesn't actually prove anything or else you could always do $old_valid_passport + $valid_photo = $new_passport but nope. Sometimes you hit special cases that drop you into having to prove your identity from your ID documents all over again.
> That means 42 percent of Americans hold a passport, a growth of 15 percent since 2007. In 1990, only four percent of Americans had one.