PoshCode Archive  Artifact [a5f40fcb04]

Artifact a5f40fcb04db256abcb1cfe80f7efaab9caba25567cb65657e898fd0e18b422f:

  • File Decrypt-Psi-Password.ps1 — part of check-in [fdc189f288] at 2018-06-10 13:28:05 on branch trunk — Script courtesy of Jaykul, I’m just reposting. This script will decode the passwords for all accounts in the Psi profile labeled “default”. (user: jvarga size: 896)

# encoding: ascii
# api: powershell
# title: Decrypt Psi Password
# description: Script courtesy of Jaykul, I’m just reposting.  This script will decode the passwords for all accounts in the Psi profile labeled “default”.
# version: 0.1
# type: function
# author: jvarga
# license: CC0
# function: decrypt-psi
# x-poshcode-id: 3597
# x-archived: 2012-09-05T18:39:26
# x-published: 2012-08-28T04:49:00
#
# halr9000: gave post a proper title
#
function decrypt-psi ($jid, $pw) {
   $OFS = ""; $u = 0;
   for($p=0;$p -lt $pw.Length;$p+=4) {
      [char]([int]"0x$($pw[$p..$($p+3)])" -bxor [int]$jid[$u++])
   }
}

$accounts = ([xml](cat ~\psidata\profiles\default\accounts.xml))["accounts"]["accounts"]

foreach($account in ($accounts | gm a[0-9]*)) {
   $a = $accounts.$($account.Name) 
   "$($a.jid.'#text'):$( decrypt-psi $a.jid.'#text' $a.password.'#text' )"
}