Web browser security

shadowbuddy

New member
Joined
Oct 19, 2011
Messages
3
Programming Experience
Beginner
Hey Guys!

So, in my application theres a web browser that basically goes to example.com/example.pdf . However, I don't want people to be access it through the URL, is it possible for me to put a password, or something of that sort on it, so if they went to example.com/example.pdf they would be asked for a password, however, the program is able to access the web page.

Thanks!
 
I'm not entirely sure what you mean, but perhaps you could just put a password on the pdf itself? (Only if you have access to the ftp server. If not, I'm not sure what you mean.)

EDIT:
So basically the program would automatically enter the password for you?
 
I'm not entirely sure what you mean, but perhaps you could just put a password on the pdf itself? (Only if you have access to the ftp server. If not, I'm not sure what you mean.)

EDIT:
So basically the program would automatically enter the password for you?

Lets say you're going to an FTP server. If you type in ftp://example.com a popup would come asking for a password and username. So, basiacally if they go to example.com/example.pdf a popup comes up and asks for a user and password, however the vb.net browser is able to login automatically.

Basically, so they have to use the program to view that page. To give a little background info, i'm helping out a family friend with coding a program, and they offer a course online. To meet regulations they have been forced to change the way they handle the program, and now want to have a program that you would purchase access to for a certain amount of time, and the program would load the PDF files, movies, and all that good stuff from their FTP server. However, if they tried to type in the URL of the PDF/Movie, and were able to access it, it would be a waste of money to pay for the course, and yet be able to access it for free. What he basically wants is, if they type in the URL directly it asks for a username and password, however the program has the username and password hard coded into it, and is able to login and access the data. Does that help a bit more?

EDIT:

Another example: Lets say your web browse in the application goes to example.com/example.pdf. If they were to type that into their windows browser it would load the pdf for them. They basically want to make it so, they cannot access it from their browser, only from the program. Is that possible?
 
It's hard to restrict stuff on the Internet (for example, all that people have to do is right click and go to View Source and they can see how the site is setup) but what you're wanting doesn't seem like something that would be terribly difficult to implement. While I'm not able to offer any code on this particular issue, I might be able to offer some suggestions/ideas:
  • Encrypt the .pdf and have the program decrypt it
  • Put a password on the ftp folder that the .pdf is stored in. The folder password will be hardcoded into the program, that nobody will be able to view.
  • Instead of using .pdf, create your own type of document file extension to where your program is the only one in the world that can read it.
  • Change the file extension of the .pdf to something random, and have your program change it to the proper one (client-side)
    • If somebody were to look at the contents of your site, they would see .pdf's with file extention .blah123 instead of .pdf. In return, their computer wouldn't know how to open a .blah123 file unless they had your program.
  • Change the way that the website is ran and/or was created??? (One idea is that the client would download your program which would already contain all of the .pdf content, encrypted/hidden in a way of course) You could have your program check for updates on startup to see if any of the .pdf files had been changed/added/removed.
I think the folder idea is the best bet. There are ways that you can restrict the public from viewing folders on your site, so as long as they're never able to view the source, there's no way they can find out the file name (if you give it a cryptic name) or path.

Good luck! Hopefully other users will look at your post as well. If not (because of my replies, they might think the issue is being taken care of), I would delete this topic and repost it. In which case, I apologize ;)
 
Last edited:
It's hard to restrict stuff on the Internet (for example, all that people have to do is right click and go to View Source and they can see how the site is setup) but what you're wanting doesn't seem like something that would be terribly difficult to implement. While I'm not able to offer any code on this particular issue, I might be able to offer some suggestions/ideas:
  • Encrypt the .pdf and have the program decrypt it
  • Put a password on the ftp folder that the .pdf is stored in. The folder password will be hardcoded into the program, that nobody will be able to view.
  • Instead of using .pdf, create your own type of document file extension to where your program is the only one in the world that can read it.
  • Change the file extension of the .pdf to something random, and have your program change it to the proper one (client-side)
    • If somebody were to look at the contents of your site, they would see .pdf's with file extention .blah123 instead of .pdf. In return, their computer wouldn't know how to open a .blah123 file unless they had your program.
  • Change the way that the website is ran and/or was created??? (One idea is that the client would download your program which would already contain all of the .pdf content, encrypted/hidden in a way of course) You could have your program check for updates on startup to see if any of the .pdf files had been changed/added/removed.
I think the folder idea is the best bet. There are ways that you can restrict the public from viewing folders on your site, so as long as they're never able to view the source, there's no way they can find out the file name (if you give it a cryptic name) or path.

Good luck! Hopefully other users will look at your post as well. If not (because of my replies, they might think the issue is being taken care of), I would delete this topic and repost it. In which case, I apologize ;)

Thanks for the response! How would i get an update server up and running?
 
No problem. I would imagine just upload your program to an ftp folder each time you make a revision, I don't even think you need a special update server or anything. I wouldn't quote me on this though because I haven't actually tried it. But when you compile your program, you can set the option of having it check for updates at a certain location. I'm guessing the program simply looks at the version and downloads if need be.
 
Back
Top