How do i open a pdf file with a password which is embedded in that files data in plaintext? - security

I am stuck on this problem for a while. I have a pdf file, and the password is embedded in the files data in plaintext, so I know what the password is.
However, when I try to open the pdf with Adobe Acrobat, it says it is either unsupported or corrupted but I know for sure its not corrupted.
Tried to open it, expected it to prompt for a password, but it says its unsupported or corrupted.

Related

Can't open a pdf file that I copeid from Android data folder

I have a study app that provides PDFs but these PDFs only open in the app itself even after downloading, like YouTube offline videos, I looked up for these saved files in the app data folder, but they have no extension. I tried different extensions so that I could open them, but they aren't opening.
Please help if you know how to open, I'm attaching a file via a Google Drive link.
In some systems file extensions may not be visible.
For a viewer to open a PDF, ideally it should have a file extension as .pdf.
Likewise if the file is badly defined or broken the PDF may not start with %PDF-1.7 or similar in the first line.
If a file is broken in transit parts may have become garbled and that seems to be what's happened to your personal copy of now broken pdf.
You need to repair the corruption by overwrite and save as repaired.pdf

I wanted Encrypt PDF in a Such way that it open with given MAC ADDRESS Device

I am interested to encrypt my pdf file. I used a basic password authentication system. But still, it is not secure. Online tools like ilovepdf, etc brokes my file. I also tried to convert them into kindle, but again DRM remover comes into the picture. My target customer is going to open that file offline and he can open it without any password or certificates. I am thinking of combing my private key with his computer's MAC Address to decrypt the pdf document & again after decryption he should not able to copy it or use it elsewhere. If he gives a file copy to someone, a third party not should be able to open it with a known Original MAC Address. In short,
I wanted to make a file, that should only be viewable on a specified
mac address device with no OCR or immersive reader or text Selection or editable in any form including google docs.
Let me know how can I achieve this.
I have some knowledge of Encryption algorithms and cryptography with coding also.
Assume we have pdf file, target MAC Address before any processing.

User uploads Excel sheet - filetype is application/octet-stream

I have a web application running, laravel backend, where users upload Excel spreadsheets which then get stored, base64 encoded in a database. Mostly this works fine and the file is stored, looking like:
data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,UEsDBBQABgAIAAAAIQBi7p1oXgEAAJAEAAA
However recently a user has had problems, her files get uploaded and stored as:
data:application/octet-stream;base64,UEsDBBQACAgIAGVKWk0AAAAAAAAAAAAAA
If I download her files, they appear as perfectly OK Excel sheets, and if I upload them again, even without opening them, they upload as XML spreadsheets.
Where do I start looking for the problem? At what stage does this encoding get determined? Is the the uploading OS, the uploading browser, or might Laravel be doing something behind the scenes? I am not a Laravel expert.
As #ourmandave pointed out, browsers do not have a 100% reliable way to determine a MIME type:
MIME types from browsers
In this case, the user downloaded a Google Sheet from Google Drive on a Chromebook (as .xlsx) and then uploaded the xls to me. The file was fine (and could be interpreted as an .xlsx file) but the MIME type at the file start on different Chromebooks could be:
data:application/octet-stream;base64
or just
data:;octet-stream
Conclusion: don't place too much faith in the MIME type on file upload.
In my case, the problem was not related to the browser. We tried to upload a Microsoft Excel Worksheet (.xlsx) file from several machines running on Windows. Same browser versions of Chrome (Version 83.0.4103.106), Edge (Version 83.0.478.54) and Firefox (77.0.1 (64-bit)) were used.
The difference appeared between the machines that had MS Office installed and those that didn't.
On the machines with MS office all browsers accepted the file with:
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Browsers on the machines without MS Office accepted the file with:
Content-Type: application/octet-stream

How to modify Chrome Extension, which authenticates every user through Google's OAuth 2?

I am trying to modify a small thing from an extension. All I basically need to edit, is the selector they use. If their selector is $("#firstDiv") I need it to be $("#secondDiv"). It is really that simple.
I downloaded the CRX file, extracted it, made the edit, but when I go and install it in my browser, it asks me to authenticate with Google Authenticator. Just like it's supposed to do, as it uses oAuth 2. HOWEVER, once I log into my Google account, it will not "save" the login. Right after I log in and press Log In, the tab closes and launches the same login page again on another page.
Is it possible to change that somehow? I found a semi-workaround. If I install the extension, authenticate with Google, then go make my edit in the extension folder, it works perfectly. However, I cannot send it to someone else, because the manifest.json includes my authentication key (392 characters long).
How can I modify the extension to my needs? Is there something I need to know about Google OAuth?
EDIT: Okay, I cannot even download the .crx file directly from Google, unzip the file, then move the files into a new folder, and install that script. Exactly like it came from Google. Are their .crx files signed? Is it impossible to do this?
When you download the .crx file, extract it, edit it and install it, its extension id is changed from the original one(this is the reason you are getting login page again and again). Now, client id used in extension is valid for only the original extension id. Thats why when you install it from web store it works fine because it retains its original extension id.
Solution :
You must retain the original extension id to make it work. First download crx viewer(very helpful for extension developers)
After installing crx viewer, navigate to your extension from web store. You will notice a page action(icon at the end of url). Click it , then click view source. New tab will open, then press f12 and check the console, you will find a "key" value. Copy it. Now go to your extension page again and download the extension as zip(from crx). Extract it and open its manifest.json file and paste the "key" along with value.(This step is necessary to retain extension id). Now install the extension from chrome by enabling developer's mode and clicking load unpacked extension and selecting the extracted extension. It should work now

After a user downloads a file, IE9 thinks the entire site is a threat

Before downloading the file, the site checks out fine. After downloading an .exe (non-malicious; an installer for an app used internally by website staff), the browser alerts:
This website has been reported to
contain the following threats:
Malicious software threat: This site contains links to viruses or other
software programs that can
reveal personal information stored or typed on your computer to malicious
persons.
Checking on a different computer, the site is fine. After downloading the .exe, the same message appears again.
Why does this happen? More importantly, how do I prevent it from happening?
The same does not happen in Firefox or Chrome or Safari, using their similar malware-checking features.
Do you have control over the file that is being downloaded? If so, wrap it in compression (zip, rar, or something else). Browsers do not like .exe files being downloaded.
Make the user physically have a link to the download, in a compressed format would also help. A site that tries to send the user a *.exe file would look suspicious to any browser that cares at all for its user.

Resources