Scott's Blog

学则不固, 知则不惑

0%

PowerShell Encrypting Credentials Generator

使用PowerShell运行,输入密码,生存的String会自动复制到剪贴板,直接去需要的地方粘贴即可。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Add-Type -AssemblyName System.Windows.Forms

function Read-MessageBoxDialog

{

param ([string]$Message,

[string]$WindowTitle,

[System.Windows.Forms.MessageBoxButtons]$Buttons = [System.Windows.Forms.MessageBoxButtons]::OK,

[System.Windows.Forms.MessageBoxIcon]$Icon = [System.Windows.Forms.MessageBoxIcon]::None)

Add-Type -AssemblyName System.Windows.Forms

return [System.Windows.Forms.MessageBox]::Show($Message, $WindowTitle, $Buttons, $Icon)

}

write-host "请输入原始密码:↓↓↓↓"
$inputPWD = Read-Host | ConvertTo-SecureString -AsPlainText -Force
$encryptedPWD = $inputPWD | ConvertFrom-SecureString
[Windows.Forms.Clipboard]::SetText($encryptedPWD)


Read-MessageBoxDialog -Message "已拷贝到剪贴板" -WindowTitle "安全密码制作工具" -Buttons OK -Icon Information