It wouldn't be possible to get decode the password using any esri/ArcObjects functionalities. The password word is designed to be encrypted for security reasons. What you could try instead is to just pass the byte[] object to your new PropertySet class. I tried this on my machine and it appears to work. The code I used is as follows:
public static void GetConnPropsSdeFile(string sdeFile)
{
Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");
IWorkspaceFactory pWorkspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
IWorkspace pWorkspace = pWorkspaceFactory.OpenFromFile(sdeFile, 0);
object names, values;
IPropertySet pPropSet = pWorkspace.ConnectionProperties;
pPropSet.GetAllProperties(out names, out values);
DisplayConnectionProperties(pPropSet, names);
}
public static void DisplayConnectionProperties(IPropertySet pPropSet, object properties)
{
string value = "";
string[] sNames = properties as string[];
string[] baseProps =
{
"SERVER", "INSTANCE", "DBCLIENT", "DB_CONNECTION_PROPERTIES", "DATABASE",
"AUTHENTICATION_MODE", "USER", "PASSWORD"
};
IPropertySet pPropertySet = new PropertySetClass();
for (int i = 0; i < pPropSet.Count - 1; i++)
{
value += sNames.ToUpper() + ": " + pPropSet.GetProperty(sNames) + "\n";
string key = sNames.ToUpper();
if (baseProps.Contains(key))
pPropertySet.SetProperty(key, pPropSet.GetProperty(key));
}
Console.WriteLine(value);
Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");
IWorkspaceFactory pWorkspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
IWorkspace pWorkspace = pWorkspaceFactory.Open(pPropertySet, 0);
Console.WriteLine(pWorkspace.Exists());
}