Archive: Is there a way to crypt the files in NSIS


Is there a way to crypt the files in NSIS
Dear NSIS-Users,

is there a way to crypt the files in NSIS and give the password automatic into the NSIS-Script?


There is no native support for this, but I suppose it can be achieved with custom pages and some plug-ins.


there's a lengthy discussion on this, but in short: there isn't a way that can't be compromised easily


Most of the compression plugins don't support encryption. Those that do, don't come highly recommended, or everyone would be highly recommending them, in a nutshell.

A plugin-less way is to store sensitive files in a password-encrypted self-extracting archive.

A) Create an sfx.
B) Install the sfx.

nsExec::Exec (a plugin, sorry) can run 'archive.exe' with a command line password to extract the contents to a folder of your choice.

C) Delete the sfx.

The method isn't highly recommended either, but doable.


bnicer's method is not secure in any meaning of the word, because it's trivially easy to intercept the password being sent to the extractor (doesn't matter wether the extractor is a plugin, a dll, or an executable). This is already explained in the thread Yatosho linked to.


But anyway. If you want to do some real protection, you should never do it in the installer anyway. You need to do it in your own application. Because if your installer becomes more secure, pirates will just start distributing a pre-installed copy in a zip archive, and then you lose even more.