Provide Authentication for a file. Urgent!!

            How to provide login and password for a pdf file, like if a person sends a file by mail to other person and if he opens the file he should see a window with boxes for login and password. If he enters the right password and loginname, he should see the file otherwise not?
              Like that I want to provide authentication for Word, Excel, Powerpoint files also. I think for word we can use Macros.
              Please suggest on this very soon.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


You need to set the password while creating the pdf document through acrobat writer, if you are creating the docs manually.

have a look on this link

Just I need confirmation from you..
Are you creating the documents programatically or manually?

If you WinZip the file, you can encode it with a password. That way, you can use any type of file with one password implementation.
shridhar_hcAuthor Commented:
     Thank u for quick replay of my Question.
     Ya Friends, both acrobat writer & WinZip provide such authentication for pdf and any files respectively.
     But I want to make such authentication provider S/W of our own, without changing the file format & with no other extra files except file which need to be protected. This should support files such as pdf, word, excel, ppt, etc.,
     Please help & give me details on this. Waiting for response.
     Please inform this to other also such we can wide knowledge on this matter.
     Thank u.
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

>>without changing the file format & with no other extra files except file which need to be protected.

Well of course the first goes for WinZip, but if you count the 'extra' file as the archive itself then of course the second doesn't. The trouble is, there'd be no way of doing this without at least one etra file if this is your criterion. There is nothing you can do to a file in itself to give it these 'behaviours'  ;-)
How are you supplying this file?  Is this through client-server?  If so, you can use a servlet w/ security to restrict access.
shridhar_hcAuthor Commented:
     If without any extra file is not possible. Then we can use atleast one file more, but this should  integrated with file to be protected. Can we create Virus like file which will ask for username & password when opening the protected file.
      For example, if we create a Java file/VB file or any other for taking username & password this should integrated with the file to be protected. Then while opening the protected file the Java file/VB file should open and ask for authentication.
      We can use this security provider for files which we attach to e-mails. Please ask this problem with ur friends and inform me also.
          Thank u.
What about an installer-like package? A password protected self-extracting zip file, with the protected document inside, that also opens the contained document once the self extraction is done. As a bonus you get some compression in the transfer. This will make any document a single .exe file. Somedocument.doc -> Somedocument.doc.exe.

Unfortunately, this will look a lot like a virus, both to mail servers/clients and users.

Bear in mind that the default password protection for zip files is not exactly difficult to break, it just makes it inconvenient to look at protected things. Do not use zip passwords for highly sensitive data.

A self-extracting zip file is more or less what i've already suggested apart from two things:

1. it makes it slightly easier for the user
2. it makes it harder to distribute over the wire as it's an executable, for the (virus) reasons given above

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

[paq'ed and points not refunded]

Please leave any comments here within the next seven days.
EE Cleanup Volunteer
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.