Here's mine from patch 5017... i'm not sure if it works on 5095 though. (I'm not too familiar with the password cryptography in 5095).
Code:
using System.Runtime.InteropServices;
public unsafe class PasswordCipher
{
private static uint[] _key = new uint[] {
0xebe854bc, 0xb04998f7, 0xfffaa88c, 0x96e854bb, 0xa9915556, 0x48e44110,
0x9f32308f, 0x27f41d3e, 0xcf4f3523, 0xeac3c6b4, 0xe9ea5e03, 0xe5974bba,
0x334d7692, 0x2c6bcf2e, 0xdc53b74, 0x995c92a6, 0x7e4f6d77, 0x1eb2b79f,
0x1d348d89, 0xed641354, 0x15e04a9d, 0x488da159, 0x647817d3, 0x8ca0bc20,
0x9264f7fe, 0x91e78c6c, 0x5c9a07fb, 0xabd4dcce, 0x6416f98d, 0x6642ab5b
};
public static sbyte* Decrypt(uint* password)
{
for (int i = 1; i >= 0; i--)
{
uint temp1 = *((uint*)(password + (i * 2) + 1));
uint temp2 = *((uint*)(password + (i * 2)));
for (int j = 11; j >= 0; j--)
{
temp1 = (uint)RollRight(temp1 - _key[(j * 2) + 7], (byte)temp2) ^ temp2;
temp2 = (uint)RollRight(temp2 - _key[(j * 2) + 6], (byte)temp1) ^ temp1;
}
password[(i * 2) + 1] = temp1 - _key[5];
password[i * 2] = temp2 - _key[4];
}
return (sbyte*)password;
}
public static sbyte* Encrypt(uint* password)
{
for (int i = 1; i >= 0; i--)
{
uint temp1 = _key[5] + password[(i * 2) + 1];
uint temp2 = _key[4] + password[i * 2];
for (int j = 0; j < 12; j++)
{
temp2 = (uint)RollLeft(temp1 ^ temp2, (byte)temp1) + _key[(j * 2) + 6];
temp1 = (uint)RollLeft(temp1 ^ temp2, (byte)temp2) + _key[(j * 2) + 7];
}
password[i * 2] = temp2;
password[i * 3] = temp1;
}
return (sbyte*)password;
}
public static int RollLeft(uint value, byte roll)
{
roll = (byte)(roll & 0x1f);
return (int)((value << roll) | (value >> (0x20 - roll)));
}
public static int RollRight(uint value, byte roll)
{
roll = (byte)(roll & 0x1f);
return (int)((value << (0x20 - roll)) | (value >> roll));
}
}