On 5/4/2014 5:17 PM, Dmitry Olshansky wrote:
> IMHO trying to erase sensitive information inside of a hash is doubtful.The fact that sensitive information is already unencrypted in memory is a weak point. Stretching the point in the same way we may double check all of phobos algorithms that make temporary copies to zero-out memory afterwards since they may be used on "sensitive data".
>

Well, regardless of merit, the existing SHA-1 does that already. Not 
having any objection to it, I simply did the same for the SHA-2. So 
whether it's zeroed or not, it should at least be consistent between 
SHA-1 and SHA-2. Maybe we could get input from the author of the SHA-1 
version.

I'm not 100% sold on this either way, but FWIW, we don't actually know 
that the paintext copy of the sensitive data will necessarily outlive 
the hash's working state. It's reasonable to expect that a prudent 
developer might be zeroing-out their plaintext copy as soon as they no 
longer need it - which may very well be as soon as it's ```.put()``` 
into the hash digest.