Encrypting password in a MSBuild file -
i want encrypt password supplying in following code:
<target name="default"> <!-- install service on remote machine --> <msbuild.extensionpack.computer.windowsservice taskaction="install" servicename="__testservice1" user="$(user)" password="$(password)" servicepath="c:\windows\system32\taskmgr.exe" remoteuser="$(remoteuser)" remoteuserpassword="$(remoteuserpassword)" machinename="$(remotemachine)" /> </target>
i dont want hardcode password. how can encrypt it? please provide suggestion. googled not find solution work me.
thank you.
there many ways this. describe 2 simplest:
have thought using feature of ntfs encrypting file system?
store password in file plaintext , mark file encrypted. user created file (by default) has access file (if more paranoid can restrict access proper setting acl given password file). can read password
<readlinesfromfile file="$(passwordfile)" > <output taskparameter="lines" itemname="password"/> </readlinesfromfile>
other possibility store password in registry (hklm, or hkcu), set permission selected user on key. can read registry values
in order prevent directly read password ntuser.dat (registry storage – can encrypt password inline task example way http://msdn.microsoft.com/en-us/library/ff649224.aspx)
Comments
Post a Comment