Skip to content

Instantly share code, notes, and snippets.

@molekilla
Created January 26, 2018 22:05
Show Gist options
  • Save molekilla/ab543a28cfed01aeef50406bdee4f34a to your computer and use it in GitHub Desktop.
Save molekilla/ab543a28cfed01aeef50406bdee4f34a to your computer and use it in GitHub Desktop.
Write secure string with powershell
# 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