i am saving passwords in cmd files that i replay based on their names. these files have other variables setup than just passwords:
Code: Select all
var1=xyz
var2=xyz
password=P@ssw0rd
certutil.exe would encrypt the whole file and I don't want that.
I played around with powershell and got this proof of concept for encryption:
Code: Select all
set pass=P@ssw0rd
call set "gg=powershell -executionPolicy bypass -Command $SecureString = ConvertTo-SecureString "%pass%" -AsPlainText -Force; ConvertFrom-SecureString -SecureString $SecureString;"
call %gg%
--- prints out the secure string ----
- could this be done without the use of temporary file?
- Is there a faster or a better practice commonly used by you guys?