Live data from Hacker News

ASP.NET MVC security and user management done the right way

aspsecuritykit.com

11–18 of 18 posts

Re: ASP.NET MVC security and user management done the right way

#11
post #6

Hi author here! if you have any feedback or suggestion, do let me know. you can also drop me a mail – varun@ASPSecurityKit.net ASP Security Kit is my humble attempt to solve membership management problem for applications built on ASP.NET Mvc platform. I have periodically observed that There are many common but essential requirements for most real-world web applications that aren't served well. Like action-based and r…

You say that it "Implements salted password hashing" but you don't mention the details of the method. Which method is it - bcrypt, md5, scrypt, sha1, pbkdf2 or something in-house? Why not say which? I confess that I had to look up "key stretching". Is it usual to do this, and why do you do it?

Glad you asked this. That is just a pre-launch page so it does not go into detail in length. Nothing built in-house – it uses Salted password hashing with PBKDF2-SHA1 and key stretching as mentioned on [0]. Password hashing is too delicate to write a custom algorithm.

[0] http://crackstation.net/hashing-security.htm

"Salt ensures that attackers can't use specialized attacks like lookup tables and rainbow tables to crack large collections of hashes quickly, but it doesn't prevent them from running dictionary or brute-force attacks on each hash individually. High-end graphics cards (GPUs) and custom hardware can compute billions of hashes per second, so these attacks are still very effective. To make these attacks less effective, we can use a technique known as key stretching. The idea is to make the hash function very slow, so that even with a fast GPU or custom hardware, dictionary and brute-force attacks are too slow to be worthwhile. The goal is to make the hash function slow enough to impede attacks, but still fast enough to not cause a noticeable delay for the user."

Re: ASP.NET MVC security and user management done the right way

#12
post #7

Not Open-Source then. So how do we know that it is secure?

Most of it is installed as source files in your mvc project so you are free to change and inspect things. This is where protection against XSS/XSRF/over-posting attacks is handled as in Mvc. Only the core module is delivered as closed library. But that is more of a business layer than the security layer. The best thing about the core module is that every piece is swappable (including salted password hashing with key…

These days, it's really hard to make people trust any library that they can't see the source of, especially those that manage "sensitive stuff" like authentication.

Re: ASP.NET MVC security and user management done the right way

#13

Earlier quoted context omitted.

You say that it "Implements salted password hashing" but you don't mention the details of the method. Which method is it - bcrypt, md5, scrypt, sha1, pbkdf2 or something in-house? Why not say which? I confess that I had to look up "key stretching". Is it usual to do this, and why do you do it?

Glad you asked this. That is just a pre-launch page so it does not go into detail in length. Nothing built in-house – it uses Salted password hashing with PBKDF2-SHA1 and key stretching as mentioned on [0]. Password hashing is too delicate to write a custom algorithm. [0] http://crackstation.net/hashing-security.htm "Salt ensures that attackers can't use specialized attacks like lookup tables and rainbow tables to cr…

Good answer, thanks.

I intentionally gave you some good options (PBKDF2, bcrypt) and some really bad ones (MD5, in house) to chose from. I assume that you are using a tested and trusted library to implement PBKDF2?

But isn't the work factor - the "number or iterations" in PBKDF2 is doing the same thing as key stretching, i.e. "make the hash function very slow". There is also a similar parameter in bcrypt. So you don't need to add anything else special to the crypto, and indeed shouldn't.

Re: ASP.NET MVC security and user management done the right way

#14
post #7

Earlier quoted context omitted.

Most of it is installed as source files in your mvc project so you are free to change and inspect things. This is where protection against XSS/XSRF/over-posting attacks is handled as in Mvc. Only the core module is delivered as closed library. But that is more of a business layer than the security layer. The best thing about the core module is that every piece is swappable (including salted password hashing with key…

These days, it's really hard to make people trust any library that they can't see the source of, especially those that manage "sensitive stuff" like authentication.

I'm not at all sure it's legal but it has been trivial to view decompiled source code for any .NET class with tools like Reflector for years. If you need to see how it's done, you will see it.

Re: ASP.NET MVC security and user management done the right way

#15

Earlier quoted context omitted.

Glad you asked this. That is just a pre-launch page so it does not go into detail in length. Nothing built in-house – it uses Salted password hashing with PBKDF2-SHA1 and key stretching as mentioned on [0]. Password hashing is too delicate to write a custom algorithm. [0] http://crackstation.net/hashing-security.htm "Salt ensures that attackers can't use specialized attacks like lookup tables and rainbow tables to cr…

Good answer, thanks. I intentionally gave you some good options (PBKDF2, bcrypt) and some really bad ones (MD5, in house) to chose from. I assume that you are using a tested and trusted library to implement PBKDF2? But isn't the work factor - the "number or iterations" in PBKDF2 is doing the same thing as key stretching, i.e. "make the hash function very slow". There is also a similar parameter in bcrypt. So you don'…

No third party library. It uses standard algorithms like Rfc2898DeriveBytes (for pbkdf2), RNGCryptoServiceProvider ETC defined in System.Security.Cryptography (bundled into the .NET framework)

Re: ASP.NET MVC security and user management done the right way

#16

Earlier quoted context omitted.

Good answer, thanks. I intentionally gave you some good options (PBKDF2, bcrypt) and some really bad ones (MD5, in house) to chose from. I assume that you are using a tested and trusted library to implement PBKDF2? But isn't the work factor - the "number or iterations" in PBKDF2 is doing the same thing as key stretching, i.e. "make the hash function very slow". There is also a similar parameter in bcrypt. So you don'…

No third party library. It uses standard algorithms like Rfc2898DeriveBytes (for pbkdf2), RNGCryptoServiceProvider ETC defined in System.Security.Cryptography (bundled into the .NET framework)

I'd advice bcrypt for it's slow hashing though.

I'd makes bruto forcing harder - longer :-)

Re: ASP.NET MVC security and user management done the right way

#17

Earlier quoted context omitted.

No third party library. It uses standard algorithms like Rfc2898DeriveBytes (for pbkdf2), RNGCryptoServiceProvider ETC defined in System.Security.Cryptography (bundled into the .NET framework)

I'd advice bcrypt for it's slow hashing though. I'd makes bruto forcing harder - longer :-)

No Problem – the power of ASP Security Kit hlies in its flexibility and extensibility. You can provide your own implementation for most things including hashing routines if you don't find existing implementation suited for your particular needs. Till now, it is either not possible (in some cases) or difficult (in other cases) in the default ASP.NET implementation for membership management.

Re: ASP.NET MVC security and user management done the right way

#18

Earlier quoted context omitted.

I'd advice bcrypt for it's slow hashing though. I'd makes bruto forcing harder - longer :-)

No Problem – the power of ASP Security Kit hlies in its flexibility and extensibility. You can provide your own implementation for most things including hashing routines if you don't find existing implementation suited for your particular needs. Till now, it is either not possible (in some cases) or difficult (in other cases) in the default ASP.NET implementation for membership management.

I'll check it out soon.

My i ask, what do you use asp.net mvc for?

Myself (@Belgium):

ASP.Net MVC mostly for: - Ecommerce - Invoicing application (SMB development) - DDD application

Post reply on HN