英文:
How to Check if the uploaded file has signature
问题
如何检查通过输入字段上传的文件是否具有签名?在将其转换为Base64后,验证是否包含任何签名的过程是什么?
英文:
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?
答案1
得分: 1
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.
- L1NpZ
- IC9TaWc
- ZS9TaWcK
- cGUvU2ln
and you can see a pattern but how could you tell this is a match too.
- U0lHTkFUVVJF
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.
Answer
From a programmers perspective
So if it is 3 times or more (x9 x27 x87) to do a quick test then it will be faster to compress the base64 back to binary and do a single test there.
And for that there are several answers but this one is not a recommendation for any.
I would simply filter 1st based on "/Sig" then try to verify that signature.
英文:
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.
- L1NpZ
- IC9TaWc
- ZS9TaWcK
- cGUvU2ln
and you can see a pattern but how could you tell this is a match too.
- U0lHTkFUVVJF
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.
Answer
From a programmers perspective
So if it is 3 times or more (x9 x27 x87) to do a quick test then it will be faster to compress the base64 back to binary and do a single test there.
And for that there are several answers but this one is not a recommendation for any.
I would simply filter 1st based on "/Sig" then try to verify that signature.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论