C# XML Stream of encrypted XML file
I have used the Rijndael algorithm (System.Security.Crytogrhapy.RijndaelManaged) to encrypt and decrypt a XML file. To give some background, my company changes the Administrator password once every three months or when someone from the IT department or Administrators group leaves the company for whatever reason. This means that the Administrator password may get changed often. The change is deployed through the network and may not touch all PCs, especially laptops. The PCs that are missed may have the previous or second previous Administrator password.
Certain programs can only be run if the person logged into the PC is the Administrator, so I use C# to run as the Administrator. The XML file mentioned above has the current and last two previous Administrator passwords in child nodes. My idea was to decrypt the XML file, read the nodes, determine what Administrator password is on the system and encrypt the XML file once again.
My client has asked that instead of making the XML file human readable, even for a second, that I stream the file into memory, decrypt it, read the child nodes from memory, determine the correct Administrator password then delete the stream. I am not dead-set on keeping this an XML file, but I would like to.
Can someone help me with this?