I'm trying to decrypt my MSMUserData on a WPA2 Enterprise Network using PowerShell 7, but I keep running into an error when I attempt to decrypt the second layer. Here's the code I'm working with: I start by defining the paths for the decrypted data files, then I attempt to load the first-level decrypted data from a specified file. After that, I'm using the `Unprotect` method for the second-level decryption with the `LocalMachine` scope. Finally, I'm saving the decrypted data to another file. Unfortunately, I keep getting an error that says the data is invalid, and it also states that the bytes cannot be null when trying to write to the file. I'm not sure what I'm doing wrong. Can anyone help me figure this out?
2 Answers
It sounds like the issue might be related to the encryption key not being available on the machine you're working on. Where exactly did you get the data from? It could help narrow down the problem.
From what I gathered, you might have better luck running the decryption process as `SYSTEM` or using the `CurrentUser` scope instead of `LocalMachine`. The `LocalMachine` scope is generally used when the data is meant for all users on the machine, but it seems like your key might be specific to the `SYSTEM`.
I actually tried that under different user levels, including `SYSTEM`, but I still ran into the same issue.
I retrieved it from the registry key.