mheyman / Isopoh.Cryptography.Argon2

Fully managed .Net Core implementation of Argon2
Other
196 stars 9 forks source link

Memory allocate issue ? #41

Closed x0rld closed 2 years ago

x0rld commented 2 years ago

Hi, I'm using Rider and the IDE warn me about memory is it a normal or there is an issue with the memory allocated ? image

mheyman commented 2 years ago

Argon2 has the ability to eat a lot of memory depending on the configuration parameters - that is one of its defenses against brute-force cracking with specialized processors. You want to use more RAM if you are afraid of well-funded adversaries.

The memory cost parameter defaults to using 64MB. I don't recall if there is any inflation under the hood that would multiply that by 8 or not (I suspect not). So, it is possible the parameters used to create the hash you are verifying had a higher memory cost baked in.

I'll double check when I get a chance because there should certainly not be a factor of 8 increase in RAM usage over the memory cost value. I've used ReSharper with the source and cleaned all its warnings but I haven't touched that code recently and ReSharper's analytics may have improved (I suspect Jetbrains uses the same analytics engine in ReSharper as Rider).