How can I check if a file uploaded through an input field has a signature? After converting it to Base64, what is the process to verify if it contains any signature?
Question posted in Javascript
A very good W3school tutorial can be found here.
A very good W3school tutorial can be found here.
2
Answers
Could you please clarify if the uploaded file should have a specific signature that matches a known signature, or if it can have any signature that is not known or controlled by you?
After conversion of anything (PDF or not) to base 64 you will require at least 6 times the effort. So to detect one single word here are some of its fingerprints.
and you can see a pattern but how could you tell this is a match too.
Thus the only reliable method is permutate manifold the endless possibilities or reverse to Plain Text.
The secondary issue is that a PDF signature could be encoded or encrypted or both or neither or perhaps compressed, so the permutations become ad infinitum.
So you need to use a plain text string as a signature and then its only one of three to detect. This file was signed and is now not signed but still has the fingerprint of a signature.