The Rfc2898DeriveBytes class derives a new cryptographic key from a given string password. As I understand it, this is supposed to increase the security of the given keys as you never have to store the key permanently - it can always be derived from a value known to the user. However, since it only takes a string
value as input the original password stays around in memory until it's GC'd. It seems to me that this is a potential security issue just as dangerous as storing the key itself on the system. The .NET framework provides a SecureString implementation to protect the password in memory. But Rfc2898DeriveBytes does not accept a secure string.
Is there any way to generate a crypto key from a SecureString?