I’ve been really looking at enhancing some of my own personal security models as of late and for accounts that i have for internal only but typically can only be accessed with a web interface so I couldn’t make use of exported credential Passwords as I would prefer to.
So to get round this issue I built this nice little function, which takes a String input from you and a type definition Integer to determine whether you are passing the plaintext version and wanting the Hashed version of the Password returning or whether you want to get the plaintext version of a previously hashed password.
What this will do is turn your normal phrase into as base64 encoded string – Although this only really adds a small further layer of security it could be used to simplify your password management – think of this as a level of Security by Obscurity
I know that it has simplified mine considerably.
So as an example to this Function you would run it as below specifying that the type is 2 as this will convert the password into a base64 encoded string
And it would output the following
You can then also see that this stores this in a Global Variable which we can see is defined as $Hpwd
So as this is stored in a Variable this can then be fed either to the same function again or can be used within other script areas.
So for example you could then run the function as following using the type as 1 to return the unhashed Password
And the result would be
Hopefully you may find this little Function useful or even have some suggestions on how this could be improved further.
The ability to add in the Scripts is thanks to this Brilliant PowerShell ISE Addon CopyToHtml created by Gary LaPointe which you can find at http://blog.falchionconsulting.com/index.php/2012/10/windows-powershell-v3-ise-copy-as-html-add-on/