marcellopato's avatar

Check if a Driver License is a REAL driver license

Hello everybody! There is now a day a library to check if some image of a document is really the image of that document? I mean, if the input field is designed to upload a driver license, can I check if it is a REAL driver license, or at least, if it looks like a driver license? Let´s say I pre-scan some documents as templates, like a Brazilian drivers license and then compare it with the one the user uploads.

0 likes
11 replies
jlrdw's avatar

I don't know about Brazil, but if like the U.S. Most States, (Texas does) has a service for a fee of course you can verify this stuff.

You may need to contact a Government entity in Brazil that handles DL, and ask if they have such a service.

I'm sure there are other companies that offer the service, but I have always just used the States service.

Was actually set up for a non profit.

martinbean's avatar

@marcellopato Then you get in the realm of data protection laws, which most country has.

You can’t just have scans of personal documents like driving licences going through and being stored by your application. If your application is compromised, you’re opening yourself up to a lot of trouble.

marcellopato's avatar

@MARTINBEAN - But there´s a lot of GED that does that. And what is the difference between text data and image data? The protection should be the same. The issue is: it is possible to compare images to see if they match? With that, I´ll be able to be sure that the user is uploading a driver license at the driver license field, even though the field has an id, name, and v-model.

martinbean's avatar

@MARCELLOPATO - I don’t know what “GED” is, but you need a real reason for handling sensitive information on citizens such as their driving license.

marcellopato's avatar

@MARTINBEAN - Of course, you do, didn´t mean to be rude, sorry. Driver license is just an example, but I do need to be certain that uploaded doc is really been uploaded at the correct input field.

Cronix's avatar

I'm pretty sure I could photoshop a pic of a drivers license, edit the pic and text, and get it right past your system that is relying only on image comparison for automatic verification. All of the security features of the drivers license like holograms, rfid chips and invisible seals/inks that show up under different lights won't come through on a scan/pic. Brazilian driver's licenses have several of those security features according to Google.

All you'd really be able to tell is "yes, it looks similar to a license." You probably couldn't determine if it actually belongs to the person who uploaded it or if it was an image of a drivers license downloaded off the internet or something. Search google images for "brazil drivers license." Do you think it would be hard to fool your system by just editing one of those? I'm not sure the point of saying "yes, this looks like a license" vs "yes, this is a valid license issued to the person who submitted it"

1 like
marcellopato's avatar

@CRONIX - Thanks a lot! The real point is "Yes, it looks like a license". It is just to spear real people to do a visual comparison. But, that´s not an emergency, it will be a cool feature, I guess!

Cronix's avatar

I've never used one, but if you search google for "php image comparison" and "php image similarity" you'll find some results. There are packages that will basically say "They're 80% similar" which would probably be "good enough" for what you're doing after you do some tests to find the threshold. I have no recommendations on what to use.

1 like
Cronix's avatar

This one looked interesting. https://kosinix.github.io/grafika/compare-images.html

When you're testing and looking at packages, check to see if the package also rotates the images when comparing. Like, I'm wondering what will happen if they upload an image that is upside down or landscape instead of portrait (or vice versa), etc. Or, if they upload a grayscale image kind of thing. Not everybody will be uploading the way you are expecting so you'll need to think of various scenarios.

1 like

Please or to participate in this conversation.