Jump to content

How to encrypt strings in script?


Recommended Posts

Hello.

I have the need to create a uninstall script for a piece of software which requires a uninstall password which changes depending what the first syntax is passed to the uninstall script.  For example if the user runs:

uninstall.exe naclient I would need to run in my script the uninstall string "msiexe.exe /x {guid} /qn UPWD:<the password associated with naclient> RMCONFIG=1"

uninstall.exe saserver I would need to run in my script the uninstall string "msiexe.exe /x {guid} /qn UPWD:<the password associated with saserver> RMCONFIG=1"

I have everything working but unsure how to encrypt the uninstall password that will be in the source code and then decrypt then when running the uninstall string when the uninstall.exe is run with only one syntax.

Link to comment
Share on other sites

Take a look at the help file for:  _Crypt_EncryptData

Also, if you have access to an SQL server it's a much better option to store encrypted data outside of your code so the user running the script will need authentication to the SQL server to retrieve the encrypted password then use the _Crypt_DecryptData to change back to a string in the code.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...