mheyman / Isopoh.Cryptography.Argon2

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

Very slow on hashing #21

Closed ldsenow closed 4 years ago

ldsenow commented 5 years ago

Not sure why is so slow on one of the servers that I have, the spec of the server is 4 cores, 2.5ghz, 16g memory, win2012 server and bellow is my argon2i config (.net 4.72)

Argon2Config Argon2DefaultConfig = new Argon2Config
        {
            Type = Argon2Type.DataIndependentAddressing,
            Version = Argon2Version.Nineteen,
            TimeCost = 3,
            Lanes = 4,
            MemoryCost = 64 * 1024,
            Threads = 1,
            HashLength = 32,
        };

I don't think it is a very high requirement. However, it takes 20s to hash a password. I don't what is wrong there.

Is there any gotcha?

Look forward to hearing the response

mheyman commented 4 years ago

I believe the issue was with the behavior that, by default, there was a calculation of the maximum lockable size on any lock fail in SecureArray. That calculation takes a lot of time and is really only useful for debugging or giggles. It is now off by default and settable by a static variable.