File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change
1
+ $Password = Get-Content - Path " .\Password.txt"
2
+ $DecryptProcess = $Password | ConvertTo-SecureString
3
+ $Code = [Runtime.InteropServices.Marshal ]::PtrToStringAuto([Runtime.InteropServices.Marshal ]::SecureStringToBSTR($DecryptProcess ))
4
+ Write-Host $Code
Original file line number Diff line number Diff line change
1
+ $PassowrdInput = Read-Host " Write your password"
2
+
3
+ $PasswordText = $PassowrdInput
4
+ $PasswordSecureString = ConvertTo-SecureString $PasswordText - AsPlainText - Force
5
+ $PasswordEncrypted = ConvertFrom-SecureString - SecureString $PasswordSecureString
6
+ $PasswordPath = " .\Password.txt"
7
+ $PasswordEncrypted | Out-File - FilePath $PasswordPath
8
+ Write-Host " The Encrypted password have been saved in $PasswordPath !" - ForegroundColor Green
You can’t perform that action at this time.
0 commit comments