How to create PDF file with password protection after download? - pdfsharp

I have a new requirement: PDF file should be password protected after download. It should be password protected not at the time of view, but at the time of download and when tried to open. I want to use PDFsharp.

Check the Protect Document sample:
http://pdfsharp.net/wiki/ProtectDocument-sample.ashx
And don't forget to pass the "user" password to the user. User must (*) enter the password after the download when opening the file.
If you want the user to enter a password before the download, then the password protection must be implemented on the web site, not in the PDF file.
(*) Adobe Reader will prompt for the password, but other programs may display the file without password.

Related

Encrypted - Password Protect VBS Script

I would like to password protect my vbs script so you have to enter a password to be able to run it.
But, not as a popup box but as a command line argument.
Thanks

Unix switch user using password from file

How can I switch user using su command and adding password from file ?
I want to make a script which will automatically switch the user, having the user and the password ,without manually typing the password.
Note: I don't have super user rights.

Access 2010 How to save password when creating linked table

I have an Access 2010 database with linked tables that connect to a sql server database. I do not have the connections set as a trusted connection, instead I want the linked tables to connect to the sql server login and password I provide. For users who are accessing this over our network it is still prompting for the password even though it displays the login id. Is there a way to make Access save the password as well in Access?
I found that in order to save a password in the DSN, I had to create a File DSN and in that file I had to be sure to include a field for the password such as:
PWD=mypassword
But there is a risk of exposing the password in a file. Ultimately, we decided that it was better to make users enter the password, which will be prompted for on just the first time they try to get a result from a query or table after they open the Access database file.

How to decrypt the NSF file

I have a NSF file which I want to decrypt so that it can be opened without password.
I have changed the encryption settings of the database to "Do not locally encrypt this database". Now I need to locally replicate this database, so that the new replica would be opened without password. Please let me know the correct procedure to achieve this.
Thanks in advance.
To access the NSF file through the Notes client the user will have to authenticate using a local ID file - regardless of whether NSF encryption is used.
The user will be asked for a password as soon as the client is opened, in this case when the user opens the NSF file.
To avoid the user being asked for a password, you can do one of the following:
Make sure the Notes client is already open, and a user logged in.
Use a user ID with a blank password.
Setup some kind of SSO, for example by using the same password used for Windows.
Bear in mind that IF the NSF file is encrypted, it should be encrypted using the same ID file later used to open it.
After setting "Do not locally encrypt this database" you only need to compact the database. Then the database is not encrypted with user's Notes-id anymore and others can open the database locally too.
You can compact your database right in Notes Client workspace:
Select the database
Choose File - Database - Properties
Click the "Info" tab.
Click button "Compact"

send hashed password to user after registering the user

I modified register usercontrol with my custom fields. In this control it doesn't have password field. I am generating password randomly with Membership.GeneratePassowrd() method. I am sending email to the user after registering using Membership.Getuser(username).GetPassword() method.Every thing is fine when i kept the PassowrdFormat=Clear in web.config file. Now i want to change to passwordFormat=Hashed. But if i use the passwordFormat as Hased then it is unable to retrieve the password. Bottom line is i want to send the password to the user which is hashed one. What is the workaround for this one. I am searching in google, but no suitable answers were found. It would be great full if any one give your helping hand.
I followed these link1, link2 but didn't give any solution.
As far as I am aware it's not possible to derive the plain text password from the hashed password stored in the database. If you need to send the plain text password via e-mail then you will need to keep track of it separately.
Depending on how your code is written it could just be as straightforward as saving the result of Membership.GeneratePassword() to a string variable and ensuring you send that in the e-mail and not any password values retrieved from the database.

Resources