This GUI tool is written using PowerShell and it helps encrypt given password and then decrypts that text to Password back. My colleague schedules PowerShell scripts a lot. Generally as best practice they do not use clear text password in their scripts. Instead they wanted to keep it in the encrypted form so passwords cannot be viewed in the clear text while editing or sharing. Also they wanted to check what is the password, with this GUI tool.
Note: Anyone can decrypt the encrypted text. You will have to make a plan and make strategy to secure the text files. Architect such way that text and secure key cannot be accessed by everyone. Another note you cannot use encrypted password text on another system directly unless you have correct secure key.
How to use this Password Encrypt/Decrypt tool?
To start with simple encryption after launching this utility, type your password in the textbox (password is hidden) and click encrypt password button.
Save the text to .txt file, To use this encrypted password text in your powershell ps1 script file, use below code to decrypt password.
$encryptedText = Get-Content EncryptedText.txt $securePassword = $encryptedText | ConvertTo-SecureString $decryptedPassword = [System.Net.NetworkCredential]::new("", $securePassword).Password
Variable $decryptedPassword stores your decrypted password, and it can be use it to authenticate.
In the next example if you need more security and is planning to use 16 bit secure key, use below code with EncryptedText.txt file and SecureKey.csv file which you saved with this GUI.
$encryptedText = Get-Content EncryptedText.txt $secureKey = Import-Csv SecureKey.csv [Byte[]]$byteKeys = ( $secureKey.Key1,$secureKey.Key2,$secureKey.Key3,$secureKey.Key4,$secureKey.Key5,$secureKey.Key6,$secureKey.Key7,$secureKey.Key8,$secureKey.Key9,$secureKey.Key10,$secureKey.Key11,$secureKey.Key12,$secureKey.Key13,$secureKey.Key14,$secureKey.Key15,$secureKey.Key16) $securePassword = $encryptedText | ConvertTo-SecureString -Key $byteKeys $decryptedPassword = [System.Net.NetworkCredential]::new("", $securePassword).Password
You can download this EncryptDecrypt_PasswordTool.ps1 here or it is also available on github.com/janviudapi
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 |
<# .SYNOPSIS Encrypt and Decrypt Password to use in scripts. .DESCRIPTION This is PowerShell GUI tool to encrypt and decrypt Password. This tool helps you to generate and store encrypted password in .txt file. Additionally you can generate and store Secure Keys in .csv file. Both of txt and csv file you can use to decrypt password later for use. .PARAMETER Name No Parameter is required .INPUTS Password, Password .txt file, Secure Key, .csv file for Secure key. .OUTPUTS System.String, Array. Encrypted Password key, Array of secure keys, txt and csv file, Decrypted clear text password. .EXAMPLE PS> EncryptDecrypt_PasswordTool.ps1 .LINK Online version: http://vcloud-lab.com .NOTES -------------------------------------------------------------------------------- Generated on: 27-05-2023 15:10 Generated by: vJanvi Environment: Microsoft Windows 11 PowerShell Version 7 -------------------------------------------------------------------------------- #> function Get-EncryptDecryptPassword { #region Import the Assemblies [void][reflection.assembly]::Load('System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') [void][reflection.assembly]::Load('System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') [void][reflection.assembly]::Load('System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') #endregion Import Assemblies [System.Windows.Forms.Application]::EnableVisualStyles() $formPasswordEncryption = New-Object 'System.Windows.Forms.Form' $buttonHowToHelp = New-Object 'System.Windows.Forms.Button' $labelPasswordFileLocation = New-Object 'System.Windows.Forms.Label' $buttonGenerateKey = New-Object 'System.Windows.Forms.Button' $statusstrip1 = New-Object 'System.Windows.Forms.StatusStrip' $buttonLoadTextFromFile = New-Object 'System.Windows.Forms.Button' $buttonLoadSecureKey = New-Object 'System.Windows.Forms.Button' $labelSecureKeyFileSavedTo = New-Object 'System.Windows.Forms.Label' $textboxKey16 = New-Object 'System.Windows.Forms.TextBox' $textboxKey15 = New-Object 'System.Windows.Forms.TextBox' $textboxKey14 = New-Object 'System.Windows.Forms.TextBox' $textboxKey13 = New-Object 'System.Windows.Forms.TextBox' $textboxKey12 = New-Object 'System.Windows.Forms.TextBox' $textboxKey11 = New-Object 'System.Windows.Forms.TextBox' $textboxKey10 = New-Object 'System.Windows.Forms.TextBox' $textboxKey9 = New-Object 'System.Windows.Forms.TextBox' $textboxKey8 = New-Object 'System.Windows.Forms.TextBox' $textboxKey7 = New-Object 'System.Windows.Forms.TextBox' $textboxKey6 = New-Object 'System.Windows.Forms.TextBox' $textboxKey5 = New-Object 'System.Windows.Forms.TextBox' $textboxKey4 = New-Object 'System.Windows.Forms.TextBox' $textboxKey3 = New-Object 'System.Windows.Forms.TextBox' $textboxKey2 = New-Object 'System.Windows.Forms.TextBox' $buttonSaveSecureKay = New-Object 'System.Windows.Forms.Button' $buttonPasswordSaveToFile = New-Object 'System.Windows.Forms.Button' $textboxSecureKey = New-Object 'System.Windows.Forms.TextBox' $checkboxWritable = New-Object 'System.Windows.Forms.CheckBox' $textboxDecryptPassword = New-Object 'System.Windows.Forms.TextBox' $buttonDecryptPassword = New-Object 'System.Windows.Forms.Button' $textboxKey1 = New-Object 'System.Windows.Forms.TextBox' $checkboxUseSecureKey = New-Object 'System.Windows.Forms.CheckBox' $buttonEncryptPassword = New-Object 'System.Windows.Forms.Button' $richtextboxEncryptedPassword = New-Object 'System.Windows.Forms.RichTextBox' $labelTypePassword = New-Object 'System.Windows.Forms.Label' $texboxPassword = New-Object 'System.Windows.Forms.TextBox' $toolstripstatuslabel1 = New-Object 'System.Windows.Forms.ToolStripStatusLabel' $toolstripstatuslabel2 = New-Object 'System.Windows.Forms.ToolStripStatusLabel' $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' #endregion Generated Form Objects # User Generated Script function Show-MessageBox { param ( [string]$Message = "Show user friendly Text Message", [string]$Title = 'Title here', [ValidateRange(0, 5)] [Int]$Button = 0, [ValidateSet('None', 'Hand', 'Error', 'Stop', 'Question', 'Exclamation', 'Warning', 'Asterisk', 'Information')] [string]$Icon = 'Error' ) #Note: $Button is equl to [System.Enum]::GetNames([System.Windows.Forms.MessageBoxButtons]) #Note: $Icon is equl to [System.Enum]::GetNames([System.Windows.Forms.MessageBoxIcon]) $MessageIcon = [System.Windows.Forms.MessageBoxIcon]::$Icon [System.Windows.Forms.MessageBox]::Show($Message, $Title, $Button, $MessageIcon) } Function Save-FileDialog { [CmdletBinding()] param ( [string]$Path = [Environment]::GetFolderPath('Desktop') ) [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null $SaveFileDialog = New-Object System.Windows.Forms.SaveFileDialog $SaveFileDialog.initialDirectory = $Path $SaveFileDialog.filter = 'txt (*.txt)|*.txt' #"All files (*.*)| *.*" $SaveFileDialog.ShowDialog() | Out-Null $SaveFileDialog.filename } Function Save-FileDialogCsv { [CmdletBinding()] param ( [string]$Path = [Environment]::GetFolderPath('Desktop') ) [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null $SaveFileDialog = New-Object System.Windows.Forms.SaveFileDialog $SaveFileDialog.initialDirectory = $Path $SaveFileDialog.filter = 'csv (*.csv)|*.csv' #"All files (*.*)| *.*" $SaveFileDialog.ShowDialog() | Out-Null $SaveFileDialog.filename } Function Open-FileDialogCsv { [CmdletBinding()] param ( [string]$Path = [Environment]::GetFolderPath('Desktop') ) [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null $SaveFileDialog = New-Object System.Windows.Forms.OpenFileDialog $SaveFileDialog.initialDirectory = $Path $SaveFileDialog.filter = 'csv (*.csv)|*.csv' #"All files (*.*)| *.*" $SaveFileDialog.ShowDialog() | Out-Null $SaveFileDialog.filename } Function Open-FileDialog { [CmdletBinding()] param ( [string]$Path = [Environment]::GetFolderPath('Desktop') ) [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null $SaveFileDialog = New-Object System.Windows.Forms.OpenFileDialog $SaveFileDialog.initialDirectory = $Path $SaveFileDialog.filter = 'txt (*.txt)|*.txt' #"All files (*.*)| *.*" $SaveFileDialog.ShowDialog() | Out-Null $SaveFileDialog.filename } function Enable-TextKeyVisibility ($Visibility = $true) { $textboxKey1.Visible = $Visibility $textboxKey2.Visible = $Visibility $textboxKey3.Visible = $Visibility $textboxKey4.Visible = $Visibility $textboxKey5.Visible = $Visibility $textboxKey6.Visible = $Visibility $textboxKey7.Visible = $Visibility $textboxKey8.Visible = $Visibility $textboxKey9.Visible = $Visibility $textboxKey10.Visible = $Visibility $textboxKey11.Visible = $Visibility $textboxKey12.Visible = $Visibility $textboxKey13.Visible = $Visibility $textboxKey14.Visible = $Visibility $textboxKey15.Visible = $Visibility $textboxKey16.Visible = $Visibility $buttonSaveSecureKay.Visible = $Visibility $textboxSecureKey.Visible = $Visibility $buttonLoadSecureKey.Visible = $Visibility $buttonGenerateKey.Visible = $Visibility } function Show-SecureKey { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $true)] [System.String]$TextboxKeyName = 'textboxKey' ) foreach ($number in 1 .. 16) { $textboxNumber = "{0}{1}" -f $TextboxKeyName, $number $singleKey = Get-Variable -Name $textboxNumber | Select-Object -ExpandProperty Value if ($number -eq 1) { $completeKeyInfo = $singleKey.Text } else { $completeKeyInfo = "{0} {1}" -f $completeKeyInfo, $singleKey.Text } } $completeKeyInfo } function Load-SecureKeyCsv { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $true)] [System.String]$TextboxKeyName = 'textboxKey', [Parameter(Position = 1, Mandatory = $true)] [System.String]$CsvFilePath ) $csvKeyData = Import-Csv -Path $CsvFilePath $csvMemberKeys = ($csvKeyData | Get-Member -Name psextended -Force).Definition.Replace('psextended {', '').Replace('}', '').Replace(' ', '') if ($csvMemberKeys -eq 'Key1,Key2,Key3,Key4,Key5,Key6,Key7,Key8,Key9,Key10,Key11,Key12,Key13,Key14,Key15,Key16') { foreach ($number in 1 .. 16) { $textboxNumber = "{0}{1}" -f $TextboxKeyName, $number $singleKey = Get-Variable -Name $textboxNumber | Select-Object -ExpandProperty Value $csvKey = "Key{0}" -f $number $singleKey.Text = $csvKeyData.$csvKey } } else { Show-MessageBox -Message "Incorrect Secure Key CSV file `nTry again" -Title 'Invalid CSV file' } } function Save-SecureKeyCSV { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $true)] [System.String]$TextboxKeyName = 'textboxKey' ) foreach ($number in 1 .. 16) { $textboxNumber = "{0}{1}" -f $TextboxKeyName, $number $singleKey = Get-Variable -Name $textboxNumber | Select-Object -ExpandProperty Value $keyNumber = "Key{0}" -f $number if ($number -eq 16) { $csvKey += $keyNumber $csvKeyValue += $singleKey.Text } else { $csvKey += "{0}," -f $keyNumber $csvKeyValue += "{0}," -f $singleKey.Text } } $csvKeyInfo = $csvKey $csvKeyInfo += "`n" $csvKeyInfo += $csvKeyValue $csvKeyInfo } function Replace-TextSecureKey { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $true)] [System.String]$TextboxKeyName = 'textboxKey' ) foreach ($number in 1 .. 16) { $textboxNumber = "{0}{1}" -f $TextboxKeyName, $number $singleKey = Get-Variable -Name $textboxNumber | Select-Object -ExpandProperty Value if (($null -eq $singleKey) -or ($singleKey.Text.trim() -eq '') -or ($singleKey.Text.trim() -eq ' ')) { $randomNumber = Get-Random -Minimum 0 -Maximum 99 $singleKey.Text = $randomNumber } } } function Generate-SecureKey { $textboxKey1.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey2.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey3.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey4.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey5.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey6.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey7.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey8.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey9.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey10.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey11.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey12.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey13.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey14.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey15.Text = Get-Random -Minimum 1 -Maximum 99 $textboxKey16.Text = Get-Random -Minimum 1 -Maximum 99 } $formPasswordEncryption_Load={ $richtextboxEncryptedPassword.ReadOnly = $true $this.FormBorderStyle = 'Fixed3D' $this.MaximizeBox = $false } $buttonEncryptPassword_Click = { $checkboxWritable.Checked = $false $richtextboxEncryptedPassword.Text = $null $textboxDecryptPassword.Text = $null $labelPasswordFileLocation.Visible = $false if ($checkboxUseSecureKey.Checked -eq $true) { Replace-TextSecureKey -TextboxKeyName textboxKey [Byte[]]$byteKeys = ( $textboxKey1.Text, $textboxKey2.Text, $textboxKey3.Text, $textboxKey4.Text, $textboxKey5.Text, $textboxKey6.Text, $textboxKey7.Text, $textboxKey8.Text, $textboxKey9.Text, $textboxKey10.Text, $textboxKey11.Text, $textboxKey12.Text, $textboxKey13.Text, $textboxKey14.Text, $textboxKey15.Text, $textboxKey16.Text ) $Password = $texboxPassword.Text | ConvertTo-SecureString -AsPlainText -Force $richtextboxEncryptedPassword.Text = $Password | ConvertFrom-SecureString -key $byteKeys } else { $Password = $texboxPassword.Text | ConvertTo-SecureString -AsPlainText -Force $richtextboxEncryptedPassword.Text = $Password | ConvertFrom-SecureString } $buttonSaveSecureKay.Enabled = $true $buttonPasswordSaveToFile.Enabled = $true } $checkboxWritable_CheckedChanged = { $textboxDecryptPassword.Text = $null if ($checkboxWritable.Checked -eq $true) { $richtextboxEncryptedPassword.Text = $null $richtextboxEncryptedPassword.ReadOnly = $false } else { $richtextboxEncryptedPassword.ReadOnly = $true } $buttonPasswordSaveToFile.Enabled = $false } $buttonDecryptPassword_Click = { #$texboxPassword.Text = $null if (($richtextboxEncryptedPassword.Text.trim() -eq 'Encrypted Password Box') -or ($richtextboxEncryptedPassword.Text -eq $null) -or ($richtextboxEncryptedPassword.Text.Trim() -eq "") -or ($richtextboxEncryptedPassword.Text.Trim() -eq " ")) { $textboxDecryptPassword.Text = $null Show-MessageBox -Message "Provide valid encrypted password in the box `nTry again" -Title 'No password found' return } if ($checkboxUseSecureKey.Checked -eq $true) { #Replace-TextSecureKey -TextboxKeyName textboxKey [Byte[]]$byteKeys = ( $textboxKey1.Text, $textboxKey2.Text, $textboxKey3.Text, $textboxKey4.Text, $textboxKey5.Text, $textboxKey6.Text, $textboxKey7.Text, $textboxKey8.Text, $textboxKey9.Text, $textboxKey10.Text, $textboxKey11.Text, $textboxKey12.Text, $textboxKey13.Text, $textboxKey14.Text, $textboxKey15.Text, $textboxKey16.Text ) try { $securePassword = $richtextboxEncryptedPassword.Text | ConvertTo-SecureString -Key $byteKeys -ErrorAction Stop $textboxDecryptPassword.Text = [System.Net.NetworkCredential]::new("", $securePassword).Password #$SecurePassword = ConvertTo-SecureString $PlainPassword -AsPlainText -Force #$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecurePassword) #$UnsecurePassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) #[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($BSTR) } catch { $textboxDecryptPassword.Text = $null Show-MessageBox -Message "Either encrypted password or Secure keys in the box is not valid. `nTry again" -Title 'Type valid encrypted password or keys' } } else { try { $securePassword = $richtextboxEncryptedPassword.Text | ConvertTo-SecureString -ErrorAction Stop $textboxDecryptPassword.Text = [System.Net.NetworkCredential]::new("", $securePassword).Password #$SecurePassword = ConvertTo-SecureString $PlainPassword -AsPlainText -Force #$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecurePassword) #$UnsecurePassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) #[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($BSTR) } catch { $textboxDecryptPassword.Text = $null Show-MessageBox -Message "Provided encrypted password in the box is not valid. `nTry again" -Title 'Type valid encrypted password' } } } $checkboxUseSecureKey_CheckedChanged = { $richtextboxEncryptedPassword.Text = $null if ($checkboxUseSecureKey.Checked -eq $true) { Generate-SecureKey Enable-TextKeyVisibility -Visibility $true } else { Enable-TextKeyVisibility -Visibility $false $labelSecureKeyFileSavedTo.Visible = $false } $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $buttonPasswordSaveToFile.Enabled = $true } #region #Part of textboxKey Cluster $textboxKey1_TextChanged={ $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey2_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey3_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey4_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey5_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey6_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey7_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey8_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey9_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey10_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey11_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey12_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey13_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey14_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey15_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } $textboxKey16_TextChanged = { $consolidatedKeys = Show-SecureKey -TextboxKeyName textboxKey $textboxSecureKey.Text = $consolidatedKeys $this.Text = $this.Text -replace '\D' } #endregion #Part of textboxKey Cluster $buttonSaveSecureKay_Click = { $labelSecureKeyFileSavedTo.Text = "Secure key csv file path:" try { $secureKeyLocation = Save-FileDialogCsv Save-SecureKeyCSV -TextboxKeyName textboxKey | Out-File -FilePath $secureKeyLocation -Force $labelSecureKeyFileSavedTo.Text = "Secure key csv file path: $secureKeyLocation" } catch { Show-MessageBox -Message "Provide valid path to save secure key. `nTry again" -Title 'No valid path to save' } $labelSecureKeyFileSavedTo.Visible = $true } $buttonPasswordSaveToFile_Click = { $labelPasswordFileLocation.Visible = $true $labelPasswordFileLocation.Text = "Encrypted password txt file path:" try { $encryptedPassword = Save-FileDialog -ErrorAction Stop $richtextboxEncryptedPassword.Text | Out-File -FilePath $encryptedPassword -Force $labelPasswordFileLocation.Text = "Encrypted password txt file path: $encryptedPassword" } catch { Show-MessageBox -Message "Provide valid path to save encrypted password. `nTry again" -Title 'No valid path to save' } } $buttonLoadSecureKey_Click = { try { $csvFilePath = Open-FileDialogCsv -ErrorAction Stop Load-SecureKeyCsv -CsvFilePath $csvFilePath -TextboxKeyName 'textboxKey' } catch { Show-MessageBox -Message "No Secure key file selected. `nTry again" -Title 'Select file' } } $buttonLoadTextFromFile_Click = { try { $txtFilePath = Open-FileDialog -ErrorAction Stop $richtextboxEncryptedPassword.Text = Get-Content $txtFilePath } catch { Show-MessageBox -Message "No password text file selected. `nTry again" -Title 'Select file' } } $buttonGenerateKey_Click={ Generate-SecureKey } $buttonHowToHelp_Click = { [void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms") $file = (get-item "$PSScriptRoot\help.png") $Form = New-Object system.Windows.Forms.Form $Form.Location = New-Object System.Drawing.Size(10, 10) $Form.Size = New-Object System.Drawing.Size(1180, 510) $Form.StartPosition = "Manual" $Form.FormBorderStyle = 'Fixed3D' $Form.MaximizeBox = $false $Form.Visible = $false $Form.Enabled = $true $Form.Add_Shown({ $Form.Activate() }) $img = [System.Drawing.Image]::Fromfile($file); [System.Windows.Forms.Application]::EnableVisualStyles(); $pictureBox = new-object Windows.Forms.PictureBox $pictureBox.Location = New-Object System.Drawing.Size(10, 10) $pictureBox.Size = New-Object System.Drawing.Size($img.Width, $img.Height) $pictureBox.Image = $img $Form.controls.add($pictureBox) $stringHelp = @' How to use this Password Encrypt/Decrypt tool? To start with simple encryption after launching this utility, type your password in the textbox (password is hidden) and click encrypt password button. Save the text to .txt file, To use this encrypted password text in your powershell ps1 script file, use below code to decrypt password. $encryptedText = Get-Content EncryptedText.txt $securePassword = $encryptedText | ConvertTo-SecureString $decryptedPassword = [System.Net.NetworkCredential]::new("", $securePassword).Password Variable $decryptedPassword has your password you can use it to authenticate. ############################################################# If you are using 16 bit secure key, use below code with EncryptedText.txt file and SecureKey csv file. $encryptedText = Get-Content EncryptedText.txt $secureKey = Get-Content SecureKey.csv $securePassword = $encryptedText | ConvertTo-SecureString -Key $secureKey $decryptedPassword = [System.Net.NetworkCredential]::new("", $securePassword).Password Variable $decryptedPassword has your password you can use it to authenticate. '@ $textBox = new-object Windows.Forms.RichTextbox $textBox.Location = New-Object System.Drawing.Size(650, 10) $textBox.Size = New-Object System.Drawing.Size(500, 450) $textBox.Text = $stringHelp $textBox.ReadOnly = $true #$textBox.Size = New-Object System.Drawing.Size($img.Width, $img.Height) #$textBox.Image = $img $Form.controls.add($textBox) $Form.Topmost = $True $rs = [Management.Automation.Runspaces.RunspaceFactory]::CreateRunspace() $rs.Open() $rs.SessionStateProxy.SetVariable("Form", $Form) $data = [hashtable]::Synchronized(@{ text = "" }) $rs.SessionStateProxy.SetVariable("data", $data) $p = $rs.CreatePipeline({ [void]$Form.ShowDialog() #$Form.Dispose() }) $p.Input.Close() $p.InvokeAsync() ## Enter the rest of your script here while you want the form to display #Start-Sleep -s 2 #$Form.close() } # --End User Generated Script-- #region Generated Events $Form_StateCorrection_Load= { #Correct the initial state of the form to prevent the .Net maximized form issue $formPasswordEncryption.WindowState = $InitialFormWindowState } $Form_Cleanup_FormClosed= { #Remove all event handlers from the controls try { $buttonHowToHelp.remove_Click($buttonHowToHelp_Click) $buttonGenerateKey.remove_Click($buttonGenerateKey_Click) $buttonLoadTextFromFile.remove_Click($buttonLoadTextFromFile_Click) $buttonLoadSecureKey.remove_Click($buttonLoadSecureKey_Click) $textboxKey16.remove_TextChanged($textboxKey16_TextChanged) $textboxKey15.remove_TextChanged($textboxKey15_TextChanged) $textboxKey14.remove_TextChanged($textboxKey14_TextChanged) $textboxKey13.remove_TextChanged($textboxKey13_TextChanged) $textboxKey12.remove_TextChanged($textboxKey12_TextChanged) $textboxKey11.remove_TextChanged($textboxKey11_TextChanged) $textboxKey10.remove_TextChanged($textboxKey10_TextChanged) $textboxKey9.remove_TextChanged($textboxKey9_TextChanged) $textboxKey8.remove_TextChanged($textboxKey8_TextChanged) $textboxKey7.remove_TextChanged($textboxKey7_TextChanged) $textboxKey6.remove_TextChanged($textboxKey6_TextChanged) $textboxKey5.remove_TextChanged($textboxKey5_TextChanged) $textboxKey4.remove_TextChanged($textboxKey4_TextChanged) $textboxKey3.remove_TextChanged($textboxKey3_TextChanged) $textboxKey2.remove_TextChanged($textboxKey2_TextChanged) $buttonSaveSecureKay.remove_Click($buttonSaveSecureKay_Click) $buttonPasswordSaveToFile.remove_Click($buttonPasswordSaveToFile_Click) $checkboxWritable.remove_CheckedChanged($checkboxWritable_CheckedChanged) $buttonDecryptPassword.remove_Click($buttonDecryptPassword_Click) $textboxKey1.remove_TextChanged($textboxKey1_TextChanged) $checkboxUseSecureKey.remove_CheckedChanged($checkboxUseSecureKey_CheckedChanged) $buttonEncryptPassword.remove_Click($buttonEncryptPassword_Click) $formPasswordEncryption.remove_Load($formPasswordEncryption_Load) $formPasswordEncryption.remove_Load($Form_StateCorrection_Load) $formPasswordEncryption.remove_FormClosed($Form_Cleanup_FormClosed) } catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } } #endregion Generated Events #region Generated Form Code $formPasswordEncryption.SuspendLayout() $statusstrip1.SuspendLayout() # formPasswordEncryption $formPasswordEncryption.Controls.Add($buttonHowToHelp) $formPasswordEncryption.Controls.Add($labelPasswordFileLocation) $formPasswordEncryption.Controls.Add($buttonGenerateKey) $formPasswordEncryption.Controls.Add($statusstrip1) $formPasswordEncryption.Controls.Add($buttonLoadTextFromFile) $formPasswordEncryption.Controls.Add($buttonLoadSecureKey) $formPasswordEncryption.Controls.Add($labelSecureKeyFileSavedTo) $formPasswordEncryption.Controls.Add($textboxKey16) $formPasswordEncryption.Controls.Add($textboxKey15) $formPasswordEncryption.Controls.Add($textboxKey14) $formPasswordEncryption.Controls.Add($textboxKey13) $formPasswordEncryption.Controls.Add($textboxKey12) $formPasswordEncryption.Controls.Add($textboxKey11) $formPasswordEncryption.Controls.Add($textboxKey10) $formPasswordEncryption.Controls.Add($textboxKey9) $formPasswordEncryption.Controls.Add($textboxKey8) $formPasswordEncryption.Controls.Add($textboxKey7) $formPasswordEncryption.Controls.Add($textboxKey6) $formPasswordEncryption.Controls.Add($textboxKey5) $formPasswordEncryption.Controls.Add($textboxKey4) $formPasswordEncryption.Controls.Add($textboxKey3) $formPasswordEncryption.Controls.Add($textboxKey2) $formPasswordEncryption.Controls.Add($buttonSaveSecureKay) $formPasswordEncryption.Controls.Add($buttonPasswordSaveToFile) $formPasswordEncryption.Controls.Add($textboxSecureKey) $formPasswordEncryption.Controls.Add($checkboxWritable) $formPasswordEncryption.Controls.Add($textboxDecryptPassword) $formPasswordEncryption.Controls.Add($buttonDecryptPassword) $formPasswordEncryption.Controls.Add($textboxKey1) $formPasswordEncryption.Controls.Add($checkboxUseSecureKey) $formPasswordEncryption.Controls.Add($buttonEncryptPassword) $formPasswordEncryption.Controls.Add($richtextboxEncryptedPassword) $formPasswordEncryption.Controls.Add($labelTypePassword) $formPasswordEncryption.Controls.Add($texboxPassword) $formPasswordEncryption.AutoScaleDimensions = New-Object System.Drawing.SizeF(8, 17) $formPasswordEncryption.AutoScaleMode = 'Font' $formPasswordEncryption.ClientSize = New-Object System.Drawing.Size(618, 522) #region Binary Data $Formatter_binaryFomatter = New-Object System.Runtime.Serialization.Formatters.Binary.BinaryFormatter $System_IO_MemoryStream = New-Object System.IO.MemoryStream (,[byte[]][System.Convert]::FromBase64String(' AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBD dWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABNTeXN0 ZW0uRHJhd2luZy5JY29uAgAAAAhJY29uRGF0YQhJY29uU2l6ZQcEAhNTeXN0ZW0uRHJhd2luZy5T aXplAgAAAAIAAAAJAwAAAAX8////E1N5c3RlbS5EcmF3aW5nLlNpemUCAAAABXdpZHRoBmhlaWdo dAAACAgCAAAAAAAAAAAAAAAPAwAAAL4QAAACAAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAA QAAAAAEAIAAAAAAAABAAADjsAAA47AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAfGRMAIBgQACAYEAAgGBAAIBgQAyAYEAAgGBAHIBgQByAYEAAgGBADIBgQACAY EAAgGBAAHhgRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAIBgQACAYEAAgGBAAIBgQASAYEAQgGBAAIBgQKiAYEMogGBDL IBgQKyAYEAAgGBAEIBgQASAYEAAgGBAAIBgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGBAAIBgQACAYEAEgGBACIBgQACAY EGAgGBD0IBgQ/yAYEP8gGBD0IBgQYSAYEAAgGBACIBgQASAYEAAgGBAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAA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AEfGBEAIRoPACAYEAEgGBAAIBgQCyAYEKAgGBD/IBgQ8iAYEDAgGBAAIBgQ AiAYEAAgGBEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBgQACAYEAAgGBAD IBgQACAYEEggGBD0IBgQ/yAYEN4gGBByIBgQLCAYEBQgGBAUIBgQLCAYEHIgGBDeIBgQ/yAYEPQg GBBIIBgQACAYEAMgGBAAIBgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAgGBAAIBgQACAYEAAgGBADIBgQACAYEC0gGBDHIBgQ/yAYEP4gGBD/IBgQ9iAYEPYgGBD/IBgQ /iAYEP8gGBDHIBgQLSAYEAAgGBADIBgQACAYEAAgGBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAgGBAAIBgQACAYEAAgGBADIBcRACAYEAMgGBBKIBgQoSAYENYg GBDtIBgQ7SAYENYgGBCiIBgQSiAYEAMgGBAAIBgQAyAYEAAgGBAAIBgQAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGBAAIBgQACAYEAAgGBADIBgQ AiAYEAAgGBAAIBgQAyAYEBEgGBARIBgQAyAYEAAgGBAAIBgQAiAYEAMgGBAAIBgQACAYEAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/9JL//+kJf//SBL//6AF//9hgv//QoL//0IF//9CBf// QoL//0KC//9CBf//QgX//0KC//5CQn/9QkK/+oJBX/kFoJ/xEkiP8hWoT/IqVE/2JCRv9CpUL/Qk JC/0KBQv8igUT/IUKE/xEkiP+QWgn/qAAV/9QAK//IABP/5MMn8L')) #endregion $formPasswordEncryption.Icon = $Formatter_binaryFomatter.Deserialize($System_IO_MemoryStream) $Formatter_binaryFomatter = $null $System_IO_MemoryStream = $null $formPasswordEncryption.Name = 'formPasswordEncryption' $formPasswordEncryption.Text = 'Password Encryption Decryption Utility' $formPasswordEncryption.add_Load($formPasswordEncryption_Load) # buttonHowToHelp $buttonHowToHelp.Location = New-Object System.Drawing.Point(488, 450) $buttonHowToHelp.Margin = '4, 4, 4, 4' $buttonHowToHelp.Name = 'buttonHowToHelp' $buttonHowToHelp.Size = New-Object System.Drawing.Size(117, 30) $buttonHowToHelp.TabIndex = 33 $buttonHowToHelp.Text = 'How to Help' $buttonHowToHelp.UseVisualStyleBackColor = $True $buttonHowToHelp.add_Click($buttonHowToHelp_Click) # labelPasswordFileLocation $labelPasswordFileLocation.AutoSize = $True $labelPasswordFileLocation.Location = New-Object System.Drawing.Point(13, 387) $labelPasswordFileLocation.Margin = '4, 0, 4, 0' $labelPasswordFileLocation.Name = 'labelPasswordFileLocation' $labelPasswordFileLocation.Size = New-Object System.Drawing.Size(223, 17) $labelPasswordFileLocation.TabIndex = 32 $labelPasswordFileLocation.Text = 'Encryption password file saved to:' # buttonGenerateKey $buttonGenerateKey.Location = New-Object System.Drawing.Point(13, 74) $buttonGenerateKey.Margin = '4, 4, 4, 4' $buttonGenerateKey.Name = 'buttonGenerateKey' $buttonGenerateKey.Size = New-Object System.Drawing.Size(139, 30) $buttonGenerateKey.TabIndex = 31 $buttonGenerateKey.Text = 'Generate Key' $buttonGenerateKey.UseVisualStyleBackColor = $True $buttonGenerateKey.Visible = $False $buttonGenerateKey.add_Click($buttonGenerateKey_Click) # statusstrip1 $statusstrip1.ImageScalingSize = New-Object System.Drawing.Size(20, 20) [void]$statusstrip1.Items.Add($toolstripstatuslabel1) [void]$statusstrip1.Items.Add($toolstripstatuslabel2) $statusstrip1.Location = New-Object System.Drawing.Point(0, 497) $statusstrip1.Name = 'statusstrip1' $statusstrip1.Padding = '1, 0, 19, 0' $statusstrip1.Size = New-Object System.Drawing.Size(618, 25) $statusstrip1.TabIndex = 30 $statusstrip1.Text = 'statusstrip1' # buttonLoadTextFromFile $buttonLoadTextFromFile.Location = New-Object System.Drawing.Point(291, 348) $buttonLoadTextFromFile.Margin = '4, 4, 4, 4' $buttonLoadTextFromFile.Name = 'buttonLoadTextFromFile' $buttonLoadTextFromFile.Size = New-Object System.Drawing.Size(153, 30) $buttonLoadTextFromFile.TabIndex = 29 $buttonLoadTextFromFile.Text = 'Load Text from file' $buttonLoadTextFromFile.UseVisualStyleBackColor = $True $buttonLoadTextFromFile.add_Click($buttonLoadTextFromFile_Click) # buttonLoadSecureKey $buttonLoadSecureKey.Location = New-Object System.Drawing.Point(488, 47) $buttonLoadSecureKey.Margin = '4, 4, 4, 4' $buttonLoadSecureKey.Name = 'buttonLoadSecureKey' $buttonLoadSecureKey.Size = New-Object System.Drawing.Size(117, 54) $buttonLoadSecureKey.TabIndex = 28 $buttonLoadSecureKey.Text = 'Load Key from CSV' $buttonLoadSecureKey.UseVisualStyleBackColor = $True $buttonLoadSecureKey.Visible = $False $buttonLoadSecureKey.add_Click($buttonLoadSecureKey_Click) # labelSecureKeyFileSavedTo $labelSecureKeyFileSavedTo.AutoSize = $True $labelSecureKeyFileSavedTo.Location = New-Object System.Drawing.Point(13, 149) $labelSecureKeyFileSavedTo.Margin = '4, 0, 4, 0' $labelSecureKeyFileSavedTo.Name = 'labelSecureKeyFileSavedTo' $labelSecureKeyFileSavedTo.Size = New-Object System.Drawing.Size(163, 17) $labelSecureKeyFileSavedTo.TabIndex = 27 $labelSecureKeyFileSavedTo.Text = 'Secure key file saved to:' $labelSecureKeyFileSavedTo.Visible = $False # textboxKey16 $textboxKey16.Location = New-Object System.Drawing.Point(433, 78) $textboxKey16.Margin = '4, 4, 4, 4' $textboxKey16.MaxLength = 2 $textboxKey16.Name = 'textboxKey16' $textboxKey16.Size = New-Object System.Drawing.Size(31, 23) $textboxKey16.TabIndex = 26 $textboxKey16.Text = '16' $textboxKey16.TextAlign = 'Center' $textboxKey16.Visible = $False $textboxKey16.add_TextChanged($textboxKey16_TextChanged) # textboxKey15 $textboxKey15.Location = New-Object System.Drawing.Point(394, 78) $textboxKey15.Margin = '4, 4, 4, 4' $textboxKey15.MaxLength = 2 $textboxKey15.Name = 'textboxKey15' $textboxKey15.Size = New-Object System.Drawing.Size(31, 23) $textboxKey15.TabIndex = 25 $textboxKey15.Text = '15' $textboxKey15.TextAlign = 'Center' $textboxKey15.Visible = $False $textboxKey15.add_TextChanged($textboxKey15_TextChanged) # textboxKey14 $textboxKey14.Location = New-Object System.Drawing.Point(355, 78) $textboxKey14.Margin = '4, 4, 4, 4' $textboxKey14.MaxLength = 2 $textboxKey14.Name = 'textboxKey14' $textboxKey14.Size = New-Object System.Drawing.Size(31, 23) $textboxKey14.TabIndex = 24 $textboxKey14.Text = '14' $textboxKey14.TextAlign = 'Center' $textboxKey14.Visible = $False $textboxKey14.add_TextChanged($textboxKey14_TextChanged) # textboxKey13 $textboxKey13.Location = New-Object System.Drawing.Point(316, 78) $textboxKey13.Margin = '4, 4, 4, 4' $textboxKey13.MaxLength = 2 $textboxKey13.Name = 'textboxKey13' $textboxKey13.Size = New-Object System.Drawing.Size(31, 23) $textboxKey13.TabIndex = 23 $textboxKey13.Text = '13' $textboxKey13.TextAlign = 'Center' $textboxKey13.Visible = $False $textboxKey13.add_TextChanged($textboxKey13_TextChanged) # textboxKey12 $textboxKey12.Location = New-Object System.Drawing.Point(277, 78) $textboxKey12.Margin = '4, 4, 4, 4' $textboxKey12.MaxLength = 2 $textboxKey12.Name = 'textboxKey12' $textboxKey12.Size = New-Object System.Drawing.Size(31, 23) $textboxKey12.TabIndex = 22 $textboxKey12.Text = '12' $textboxKey12.TextAlign = 'Center' $textboxKey12.Visible = $False $textboxKey12.add_TextChanged($textboxKey12_TextChanged) # textboxKey11 $textboxKey11.Location = New-Object System.Drawing.Point(238, 78) $textboxKey11.Margin = '4, 4, 4, 4' $textboxKey11.MaxLength = 2 $textboxKey11.Name = 'textboxKey11' $textboxKey11.Size = New-Object System.Drawing.Size(31, 23) $textboxKey11.TabIndex = 21 $textboxKey11.Text = '11' $textboxKey11.TextAlign = 'Center' $textboxKey11.Visible = $False $textboxKey11.add_TextChanged($textboxKey11_TextChanged) # textboxKey10 $textboxKey10.Location = New-Object System.Drawing.Point(199, 78) $textboxKey10.Margin = '4, 4, 4, 4' $textboxKey10.MaxLength = 2 $textboxKey10.Name = 'textboxKey10' $textboxKey10.Size = New-Object System.Drawing.Size(31, 23) $textboxKey10.TabIndex = 20 $textboxKey10.Text = '10' $textboxKey10.TextAlign = 'Center' $textboxKey10.Visible = $False $textboxKey10.add_TextChanged($textboxKey10_TextChanged) # textboxKey9 $textboxKey9.Location = New-Object System.Drawing.Point(160, 78) $textboxKey9.Margin = '4, 4, 4, 4' $textboxKey9.MaxLength = 2 $textboxKey9.Name = 'textboxKey9' $textboxKey9.Size = New-Object System.Drawing.Size(31, 23) $textboxKey9.TabIndex = 19 $textboxKey9.Text = '9' $textboxKey9.TextAlign = 'Center' $textboxKey9.Visible = $False $textboxKey9.add_TextChanged($textboxKey9_TextChanged) # textboxKey8 $textboxKey8.Location = New-Object System.Drawing.Point(433, 47) $textboxKey8.Margin = '4, 4, 4, 4' $textboxKey8.MaxLength = 2 $textboxKey8.Name = 'textboxKey8' $textboxKey8.Size = New-Object System.Drawing.Size(31, 23) $textboxKey8.TabIndex = 18 $textboxKey8.Text = '8' $textboxKey8.TextAlign = 'Center' $textboxKey8.Visible = $False $textboxKey8.add_TextChanged($textboxKey8_TextChanged) # textboxKey7 $textboxKey7.Location = New-Object System.Drawing.Point(394, 47) $textboxKey7.Margin = '4, 4, 4, 4' $textboxKey7.MaxLength = 2 $textboxKey7.Name = 'textboxKey7' $textboxKey7.Size = New-Object System.Drawing.Size(31, 23) $textboxKey7.TabIndex = 17 $textboxKey7.Text = '7' $textboxKey7.TextAlign = 'Center' $textboxKey7.Visible = $False $textboxKey7.add_TextChanged($textboxKey7_TextChanged) # textboxKey6 $textboxKey6.Location = New-Object System.Drawing.Point(355, 47) $textboxKey6.Margin = '4, 4, 4, 4' $textboxKey6.MaxLength = 2 $textboxKey6.Name = 'textboxKey6' $textboxKey6.Size = New-Object System.Drawing.Size(31, 23) $textboxKey6.TabIndex = 16 $textboxKey6.Text = '6' $textboxKey6.TextAlign = 'Center' $textboxKey6.Visible = $False $textboxKey6.add_TextChanged($textboxKey6_TextChanged) # textboxKey5 $textboxKey5.Location = New-Object System.Drawing.Point(316, 47) $textboxKey5.Margin = '4, 4, 4, 4' $textboxKey5.MaxLength = 2 $textboxKey5.Name = 'textboxKey5' $textboxKey5.Size = New-Object System.Drawing.Size(31, 23) $textboxKey5.TabIndex = 15 $textboxKey5.Text = '5' $textboxKey5.TextAlign = 'Center' $textboxKey5.Visible = $False $textboxKey5.add_TextChanged($textboxKey5_TextChanged) # textboxKey4 $textboxKey4.Location = New-Object System.Drawing.Point(277, 47) $textboxKey4.Margin = '4, 4, 4, 4' $textboxKey4.MaxLength = 2 $textboxKey4.Name = 'textboxKey4' $textboxKey4.Size = New-Object System.Drawing.Size(31, 23) $textboxKey4.TabIndex = 14 $textboxKey4.Text = '4' $textboxKey4.TextAlign = 'Center' $textboxKey4.Visible = $False $textboxKey4.add_TextChanged($textboxKey4_TextChanged) # textboxKey3 $textboxKey3.Location = New-Object System.Drawing.Point(238, 47) $textboxKey3.Margin = '4, 4, 4, 4' $textboxKey3.MaxLength = 2 $textboxKey3.Name = 'textboxKey3' $textboxKey3.Size = New-Object System.Drawing.Size(31, 23) $textboxKey3.TabIndex = 13 $textboxKey3.Text = '3' $textboxKey3.TextAlign = 'Center' $textboxKey3.Visible = $False $textboxKey3.add_TextChanged($textboxKey3_TextChanged) # textboxKey2 $textboxKey2.Location = New-Object System.Drawing.Point(199, 47) $textboxKey2.Margin = '4, 4, 4, 4' $textboxKey2.MaxLength = 2 $textboxKey2.Name = 'textboxKey2' $textboxKey2.Size = New-Object System.Drawing.Size(31, 23) $textboxKey2.TabIndex = 12 $textboxKey2.Text = '2' $textboxKey2.TextAlign = 'Center' $textboxKey2.Visible = $False $textboxKey2.add_TextChanged($textboxKey2_TextChanged) # buttonSaveSecureKay $buttonSaveSecureKay.Enabled = $False $buttonSaveSecureKay.Location = New-Object System.Drawing.Point(13, 105) $buttonSaveSecureKay.Margin = '4, 4, 4, 4' $buttonSaveSecureKay.Name = 'buttonSaveSecureKay' $buttonSaveSecureKay.Size = New-Object System.Drawing.Size(139, 30) $buttonSaveSecureKay.TabIndex = 11 $buttonSaveSecureKay.Text = 'Save Secure Key' $buttonSaveSecureKay.UseVisualStyleBackColor = $True $buttonSaveSecureKay.Visible = $False $buttonSaveSecureKay.add_Click($buttonSaveSecureKay_Click) # buttonPasswordSaveToFile $buttonPasswordSaveToFile.Enabled = $False $buttonPasswordSaveToFile.Location = New-Object System.Drawing.Point(452, 347) $buttonPasswordSaveToFile.Margin = '4, 4, 4, 4' $buttonPasswordSaveToFile.Name = 'buttonPasswordSaveToFile' $buttonPasswordSaveToFile.Size = New-Object System.Drawing.Size(153, 30) $buttonPasswordSaveToFile.TabIndex = 10 $buttonPasswordSaveToFile.Text = 'Save Text to file' $buttonPasswordSaveToFile.UseVisualStyleBackColor = $True $buttonPasswordSaveToFile.add_Click($buttonPasswordSaveToFile_Click) # textboxSecureKey $textboxSecureKey.Location = New-Object System.Drawing.Point(160, 109) $textboxSecureKey.Margin = '4, 4, 4, 4' $textboxSecureKey.Name = 'textboxSecureKey' $textboxSecureKey.ReadOnly = $True $textboxSecureKey.Size = New-Object System.Drawing.Size(445, 23) $textboxSecureKey.TabIndex = 9 $textboxSecureKey.Visible = $False # checkboxWritable $checkboxWritable.Location = New-Object System.Drawing.Point(13, 348) $checkboxWritable.Margin = '4, 4, 4, 4' $checkboxWritable.Name = 'checkboxWritable' $checkboxWritable.Size = New-Object System.Drawing.Size(247, 31) $checkboxWritable.TabIndex = 8 $checkboxWritable.Text = 'Write to Encrypted Password Box' $checkboxWritable.UseVisualStyleBackColor = $True $checkboxWritable.add_CheckedChanged($checkboxWritable_CheckedChanged) # textboxDecryptPassword $textboxDecryptPassword.Location = New-Object System.Drawing.Point(176, 419) $textboxDecryptPassword.Margin = '4, 4, 4, 4' $textboxDecryptPassword.Name = 'textboxDecryptPassword' $textboxDecryptPassword.ReadOnly = $True $textboxDecryptPassword.Size = New-Object System.Drawing.Size(429, 23) $textboxDecryptPassword.TabIndex = 7 # buttonDecryptPassword $buttonDecryptPassword.Location = New-Object System.Drawing.Point(13, 419) $buttonDecryptPassword.Margin = '4, 4, 4, 4' $buttonDecryptPassword.Name = 'buttonDecryptPassword' $buttonDecryptPassword.Size = New-Object System.Drawing.Size(155, 30) $buttonDecryptPassword.TabIndex = 6 $buttonDecryptPassword.Text = 'Decrypt Password' $buttonDecryptPassword.UseVisualStyleBackColor = $True $buttonDecryptPassword.add_Click($buttonDecryptPassword_Click) # textboxKey1 $textboxKey1.Location = New-Object System.Drawing.Point(160, 47) $textboxKey1.Margin = '4, 4, 4, 4' $textboxKey1.MaxLength = 2 $textboxKey1.Name = 'textboxKey1' $textboxKey1.Size = New-Object System.Drawing.Size(31, 23) $textboxKey1.TabIndex = 5 $textboxKey1.Text = '1' $textboxKey1.TextAlign = 'Center' $textboxKey1.Visible = $False $textboxKey1.add_TextChanged($textboxKey1_TextChanged) # checkboxUseSecureKey $checkboxUseSecureKey.Location = New-Object System.Drawing.Point(13, 44) $checkboxUseSecureKey.Margin = '4, 4, 4, 4' $checkboxUseSecureKey.Name = 'checkboxUseSecureKey' $checkboxUseSecureKey.Size = New-Object System.Drawing.Size(139, 31) $checkboxUseSecureKey.TabIndex = 4 $checkboxUseSecureKey.Text = 'Use Secure Key' $checkboxUseSecureKey.UseVisualStyleBackColor = $True $checkboxUseSecureKey.add_CheckedChanged($checkboxUseSecureKey_CheckedChanged) # buttonEncryptPassword $buttonEncryptPassword.Location = New-Object System.Drawing.Point(452, 9) $buttonEncryptPassword.Margin = '4, 4, 4, 4' $buttonEncryptPassword.Name = 'buttonEncryptPassword' $buttonEncryptPassword.Size = New-Object System.Drawing.Size(153, 30) $buttonEncryptPassword.TabIndex = 3 $buttonEncryptPassword.Text = 'Encrypt Password' $buttonEncryptPassword.UseVisualStyleBackColor = $True $buttonEncryptPassword.add_Click($buttonEncryptPassword_Click) # richtextboxEncryptedPassword $richtextboxEncryptedPassword.Location = New-Object System.Drawing.Point(13, 182) $richtextboxEncryptedPassword.Margin = '4, 4, 4, 4' $richtextboxEncryptedPassword.Name = 'richtextboxEncryptedPassword' $richtextboxEncryptedPassword.Size = New-Object System.Drawing.Size(592, 158) $richtextboxEncryptedPassword.TabIndex = 2 $richtextboxEncryptedPassword.Text = 'Encrypted Password Box' # labelTypePassword $labelTypePassword.AutoSize = $True $labelTypePassword.Location = New-Object System.Drawing.Point(13, 16) $labelTypePassword.Margin = '4, 0, 4, 0' $labelTypePassword.Name = 'labelTypePassword' $labelTypePassword.Size = New-Object System.Drawing.Size(113, 17) $labelTypePassword.TabIndex = 1 $labelTypePassword.Text = 'Type Password: ' # texboxPassword $texboxPassword.Location = New-Object System.Drawing.Point(134, 13) $texboxPassword.Margin = '4, 4, 4, 4' $texboxPassword.Name = 'texboxPassword' $texboxPassword.PasswordChar = '*' $texboxPassword.Size = New-Object System.Drawing.Size(310, 23) $texboxPassword.TabIndex = 0 $texboxPassword.Text = 'n0!Secret' # toolstripstatuslabel1 $toolstripstatuslabel1.Name = 'toolstripstatuslabel1' $toolstripstatuslabel1.Size = New-Object System.Drawing.Size(0, 20) # toolstripstatuslabel2 $toolstripstatuslabel2.Name = 'toolstripstatuslabel2' $toolstripstatuslabel2.Size = New-Object System.Drawing.Size(242, 20) $toolstripstatuslabel2.Text = 'Created with http://vcloud-lab.com' $statusstrip1.ResumeLayout() $formPasswordEncryption.ResumeLayout() #endregion Generated Form Code #Save the initial state of the form $InitialFormWindowState = $formPasswordEncryption.WindowState #Init the OnLoad event to correct the initial state of the form $formPasswordEncryption.add_Load($Form_StateCorrection_Load) #Clean up the control events $formPasswordEncryption.add_FormClosed($Form_Cleanup_FormClosed) #Show the Form return $formPasswordEncryption.ShowDialog() } #End Function #Call the form Get-EncryptDecryptPassword | Out-Null |
Useful Information
Powershell GUI System Hardware Information
Executing PowerShell script from PHP HTML web server
Send system disk space utilization HTML report Email using PowerShell
Send Email using PowerShell with .net object System.Net.Mail.MailMessage
PowerShell XML OperationStopped: No coercion operator is defined between types 'System.Object&' and 'System.Object'
Powershell Create new file if not exist, if exist Rename file
PowerShell Create XML document with XmlWriter .net object
PowerShell save export data to XML file