MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.86k stars 844 forks source link

Security Alaret #1084

Closed erfan132 closed 2 years ago

erfan132 commented 2 years ago

Hi Thanks for Developing Nbitcoin I think we have some security issues From memory because nbitcoin dosent support securestring and every private key and password not disposed from memory I think it can make some issues in feature because it can make memory leaks I konw securestring is not available for .netcore But its just for netcore So I think it’s time to add securestring to .netfreamwork version Please Add this into developing tasks

lontivero commented 2 years ago

securestring is one of those brain farts that found its way into .net but fortunately it was removed.

erfan132 commented 2 years ago

.Net Core can't have it, because Linux doesn't support encryption (securestring) But what can we do to protect private key from memory leaks?

lontivero commented 2 years ago

NBitcoin already does the best that can be done and it overrides the memory immediately after you dispose the key. You should do the same with your password.

erfan132 commented 2 years ago

Ok Thanks for you reply And developing this amazing library god bless you