PoshCode Archive  Artifact [6c45d94c60]

Artifact 6c45d94c60493e048400db9dea948efdb92448975b67cfa101b1a953423d3143:

  • File Decrypt-Psi-Password.ps1 — part of check-in [3f0ed53910] at 2018-06-10 12:56:42 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: aaajabbercz size: 865)

# 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: aaajabbercz
# license: CC0
# function: decrypt-psi
# x-poshcode-id: 1235
# x-archived: 2009-10-02T21:54:02
#
# 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' )"
}