Skip to content

Commit b17af7b

Browse files
authored
Add files via upload
1 parent 51ac48a commit b17af7b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Scripts/Decrypt-Password.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
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

Scripts/Encrypt-Password.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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

0 commit comments

Comments
 (0)