I want to store a System.SecureString in the registry. Is that possible? And how would I go about doing it?
Would my program be able to decrypt the string again when running the next time?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not possible to do in encrypted form without a helper layer. It’ doesn’t natively support any form of serialization and in fact cannot even be inspected in it’s native form. To even get any information out of it you need to go through PInvoke or the
SecureStringToBSTRAPI. Both of which will give you access to thestringin unencrypted form.One way I could see this working is
SecureStringto aBSTRviaSecureStringToBSTRBSTROf course you’d need to use an encryption mechanism which was re-usable between instances of your program.