mefisteoo Posted June 14, 2022 Share Posted June 14, 2022 (edited) Cześć! Zabezpieczyłem plik PDF poprzez bibliotekę mPDF hasłem, ale niestety teraz nie wiem jak mogę go otworzyć :(( Znam hasło i chcę aby bo kliknięciu otwórz pdf otworzył się on bez hasła. Nie wiem jakiej biblioteki użyć, aby pokazać użytkownikowi odbezpieczony plik PDF. Macie jakieś pomysły? ENGLISH: Hi! I protected the PDF file through the mPDF library with a password, but unfortunately now I do not know how I can open it :(( I know the password and I want because clicking open pdf it opened without a password. I don't know what library to use to show the user an unprotected PDF. Do you have any ideas? Edited June 14, 2022 by mefisteoo Tłumaczenie Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/ Share on other sites More sharing options...
ginerjm Posted June 14, 2022 Share Posted June 14, 2022 English? Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597270 Share on other sites More sharing options...
mefisteoo Posted June 14, 2022 Author Share Posted June 14, 2022 1 minute ago, ginerjm said: English? Done Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597271 Share on other sites More sharing options...
ginerjm Posted June 14, 2022 Share Posted June 14, 2022 Usually a user has a pdf reader on their system so attempting to open a simple pdf file should trigger that. Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597273 Share on other sites More sharing options...
mefisteoo Posted June 14, 2022 Author Share Posted June 14, 2022 2 minutes ago, ginerjm said: Usually a user has a pdf reader on their system so attempting to open a simple pdf file should trigger that. I would like my system when clicking "show PDF" it opens without a password, so that the user does not have to type it. (with us on the server, each pdf file is secured, because it contains sensitive user data: PESEL number, address of residence, contact details, insurance, etc.) Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597274 Share on other sites More sharing options...
ginerjm Posted June 14, 2022 Share Posted June 14, 2022 If the pdf was encoded with the password how could your app provide that? Could you not use a password in your app itself so that you have to enter it just to get into the app and have access to the files? You could have multiple passwords to provide access to groups of files. Store the filename in a table with a group code and check if the user has logged in with access to that group and only then show him the file. Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597275 Share on other sites More sharing options...
mefisteoo Posted June 14, 2022 Author Share Posted June 14, 2022 8 minutes ago, ginerjm said: If the pdf was encoded with the password how could your app provide that? Could you not use a password in your app itself so that you have to enter it just to get into the app and have access to the files? You could have multiple passwords to provide access to groups of files. Store the filename in a table with a group code and check if the user has logged in with access to that group and only then show him the file. I understand, but I would like to do so that when you click on the button, the user receives a file without a password. Each file on the server has a different password for security, the password for the file is in the database. Pdf file password protected by mPDF library and I am currently looking for a solution to decode the PDF file. Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597276 Share on other sites More sharing options...
ginerjm Posted June 14, 2022 Share Posted June 14, 2022 Are you saying that the password is IN the pdf file, or just in a database? If it is in the pdf file then you need to read up on what mPDF allows you to do, not here. Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597277 Share on other sites More sharing options...
mefisteoo Posted June 14, 2022 Author Share Posted June 14, 2022 9 minutes ago, ginerjm said: Are you saying that the password is IN the pdf file, or just in a database? If it is in the pdf file then you need to read up on what mPDF allows you to do, not here. I have a password for the pdf file in the database, the user does not know the password. When the user clicks "show PDF" then the script is to open the PDF that is password protected. Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597278 Share on other sites More sharing options...
ginerjm Posted June 14, 2022 Share Posted June 14, 2022 So how does the user get access to the button that gets clicked? Is there a signin procedure requiring a password of some kind? Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597279 Share on other sites More sharing options...
mefisteoo Posted June 14, 2022 Author Share Posted June 14, 2022 2 minutes ago, ginerjm said: So how does the user get access to the button that gets clicked? Is there a signin procedure requiring a password of some kind? yes, there is sms authorization Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597280 Share on other sites More sharing options...
ginerjm Posted June 14, 2022 Share Posted June 14, 2022 So the user does have to login with a password. Why can't that userid be used to determine what files the user can see and not worry about embedded passwords in the pdf files? As I already proposed, assign pdf files to groups (where you put the passwords now) and create a table that links a user id to multiple records of groups that he/she can access. When a user clicks on a pdf button check that his permissions include that group number and show the file. That's the way I would do it. It's either that or read the documentation on mPDF to see if they have an interface that allows an app to provide the password Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597281 Share on other sites More sharing options...
mefisteoo Posted June 14, 2022 Author Share Posted June 14, 2022 4 minutes ago, ginerjm said: So the user does have to login with a password. Why can't that userid be used to determine what files the user can see and not worry about embedded passwords in the pdf files? As I already proposed, assign pdf files to groups (where you put the passwords now) and create a table that links a user id to multiple records of groups that he/she can access. When a user clicks on a pdf button check that his permissions include that group number and show the file. That's the way I would do it. It's either that or read the documentation on mPDF to see if they have an interface that allows an app to provide the password we care about data security, so we do not want our files on the server to be unsecured. There is a situation that FTP access data is leaked and the hacker has user data... That's why I'm looking for a way to unlock a pdf file knowing the password to it. The mPDF library cannot remove the password or even open the protected file... Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597283 Share on other sites More sharing options...
ginerjm Posted June 14, 2022 Share Posted June 14, 2022 (edited) What does mPDF have to offer you? Obviously we can't help you here (PHP world) unless you find out what access path mPDF can provide. And BTW - you said that you have the pdf passwords stored in a database. And you have your pdf files stored on your system. If you are concerned about somebody hacking into the files what about that same person hacking into the passwords database? Edited June 14, 2022 by ginerjm Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597284 Share on other sites More sharing options...
mefisteoo Posted June 14, 2022 Author Share Posted June 14, 2022 6 minutes ago, ginerjm said: What does mPDF have to offer you? Obviously we can't help you here (PHP world) unless you find out what access path mPDF can provide. And BTW - you said that you have the pdf passwords stored in a database. And you have your pdf files stored on your system. If you are concerned about somebody hacking into the files what about that same person hacking into the passwords database? szukam tutaj rozwiązania w jaki sposób mogę odbezpieczyć plik pdf... nie koniecznie w bibliotece mPDF... If you "hack" ftp, it will not necessarily break into the database Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597285 Share on other sites More sharing options...
ginerjm Posted June 14, 2022 Share Posted June 14, 2022 Who said anything about ftp? If I can hack and get to your pdf files folder(s) What makes you think I can't do the same to your databases? I'm a hacker!! I just did some google searches and I don't see a way to bypass the user having to type in a password to read a protected pdf file without using some other utility to either unlock the pdf or decrypt it and read it. Sounds like Adobe was way ahead of its time. I think you need to rethink your plan here. Nuff said. Good luck. Good bye Quote Link to comment https://forums.phpfreaks.com/topic/314925-plik-pdf-otworzenie-zabezpieczonego-pliku/#findComment-1597286 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.