Created
January 26, 2018 22:05
-
-
Save molekilla/ab543a28cfed01aeef50406bdee4f34a to your computer and use it in GitHub Desktop.
Write secure string with powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write secure string as file | |
Write-Output "Ingrese contraseña: " | |
$Secure = Read-Host -AsSecureString | |
$Encrypted = ConvertFrom-SecureString -SecureString $Secure -Key (1..16) | |
$Encrypted | Set-Content httpbin_creds.txt | |
$Secure2 = Get-Content httpbin_creds.txt | ConvertTo-SecureString -Key (1..16) | |
$Secure2 | |
Write-Output "Archivo encriptado como httpbin_creds.txt exitosamente" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment