4 ms·
All you can do if you don't trust the OS is to assemble the password at the point of use (each time) and erase the memory location directly afterwards. And eve
by jayfuerstenberg 14y ago
All you can do if you don't trust the OS is to assemble the password at the point of use (each time) and erase the memory location directly afterwards.
And even that is not 100% foolproof (the OS can detect it in between these two steps).
- mariusmg 14y agoOr keep it encrypted in memory
- ars 14y agoAnd how exactly would that work? You would need to decrypt it use it - but then you need to store the decryption key in memory. Gaining you exactly nothing.
- lucb1e 14y agoYou could store the decryption key on the disk, only loading it when needed, and possibly byte-by-byte. This is all hackable, especially when such techniques are used mainstream, but it increases the amount of work needed to hack something. In the end it's the OS's responsibility of course.
- ars 14y agoWhat's the point of that? If you are going to do that, just store the original key that way. Not that it helps in any way at all.
- biot 14y agoThe .NET framework has a SecureString class which does this. It mitigates the risk of sensitive information being discovered through running 'strings' on memory dumps and the like. It's meant to prevent trivial recovery, not stop an attacker with sufficient time and skill.
- mariusmg 14y agoHere is a concrete implementation : SecureString in .NET http://msdn.microsoft.com/en-us/library/system.security.securestring.aspx http://msdn.microsoft.com/en-us/library/system.security.secu... It's using DAPI which derives the encryption key from the user password.
- jayfuerstenberg 14y agoYou wouldn't need to encrypt it really. Just don't store it character for character the same as the password when used to authenticate the user. You could have the even characters in one array and the odd characters in another and this would make it a bit safer. I'm not sure every app needs to be this paranoid but I offer it as an idea that can be easily implemented for those that do.
- ibotty 14y agoand how should that help? if you can read ram you can for sure read the executable file.
- twelvechairs 14y ago> Just don't store it character for character the same... You've just described encryption here, whilst saying that its not encryption. The principle is right though. A simple obfuscation will deter most attacks.
- ibotty 14y agothat was good!
- Tichy 14y agoAlso, is there a way to erase specific memory locations, and a guarantee that in the meantime that memory location has not been cached somewhere else?