Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- Accepts a password as input and renders the following output
- Also copies the output to the clipboard
- $pass = @('01000000d08c9ddf0115d1118c7a00c04fc297eb01000000d347b7678cdb8d40bf8073abefd0bb7a000000000200000000001066000000010000200000004'
- 'aa126631f8f35b721a6ce33477fcbad0eb313961ec900eeb4ef385e71b92486000000000e80000000020000200000003dafc271c57062ed6387a481b65fee32800f663c'
- 'a0827828d7489dde5f6372cd20000000ac3e85b63f6a72bb49b6301028c21ae9e964f612aea4b7bae29879493ffb8fdb40000000dbdf265894401eaf4a65527342065a1'
- '74375bb741626755b6b2a17b8c1f7013c63b1253613d21b5163d875e6cd7be7c6d7329d478ccfa1c0cf0ea65e070b1552') -join '' | ConvertTo-SecureString
- #>
- function Get-PrettySecureString {
- [CmdletBinding()]
- param (
- # Password
- [Parameter(Mandatory)]
- [string]
- $Password
- )
- $ss = $Password | ConvertTo-SecureString -AsPlainText -Force
- $tmp = $ss | ConvertFrom-SecureString
- $1 = $tmp.Substring(0, 125)
- $2 = $tmp.Substring(125, 135)
- $3 = $tmp.Substring(260, 135)
- $4 = $tmp.Substring(395, 97)
- $res = "`$pass = @('{0}'`r`n'{1}'`r`n'{2}'`r`n'{3}') -join '' | ConvertTo-SecureString" -f $1, $2, $3, $4
- $res | clip
- Write-Host 'The following code has been copied to your clipboard:' -ForegroundColor DarkYellow
- Write-Host $res -ForegroundColor DarkGray
- }
- Get-PrettySecureString -Password 'Testing1234'
- <#
- C:\> Get-PrettySecureString -Password 'Testing1234'
- The following code has been copied to your clipboard:
- $pass = @('01000000d08c9ddf0115d1118c7a00c04fc297eb01000000d347b7678cdb8d40bf8073abefd0bb7a000000000200000000001066000000010000200000002'
- '592b8c73120c0885254d2c51f5d281a61c82aa48237b3aec0e626b0b9013d23000000000e8000000002000020000000044b02d655f9e356d1b7c0b02973c440c52599a7'
- '9f52ca9589d62398204718d220000000bfca4a491ebcad6d59dadda99b27fc3c7afaf6c5660253cf4b707e6cdbf31810400000002a3759742e8687f228526af37efc7a7'
- 'c7014b829c7135a3dfcda8554c3f1a5fb5dfe77f3f5cb1ddba12d3e2a575259b21f5445b8cba1823dee0ce97d20b95da4') -join '' | ConvertTo-SecureString
- #>
Add Comment
Please, Sign In to add comment