Solved

SQL Server Express Triggers to Compare hashed passwords before updating user passwords

Posted on 2014-11-25
4
110 Views
Last Modified: 2015-01-12
I recently asked a question where i need to develop a way to compare the last 5 passwords for a user before they update their password in a SQL database prior to the password being changed.  I asked this using the .Net engine http://www.experts-exchange.com/Database/MS-SQL-Server/Q_28553621.html and seem to not be making it very far.

It made me think that this has to be a common issue that maybe i'm not looking at it the right way.  Is there a way to use SQL Server Triggers or procedures to compare the hashed passwords.   For example, I have a PasswordHistory table in the database that stores the history of the hashed password which are copies of the hashed password in the aspnet_Membership table for the users.  I imagine that you could create a temporary table that the password that is suggested is first inserted and then if it is a comparison reject the update of the membership table.  

I have no real idea how to write SQL Triggers or Procedures so I am reaching out to you all to see if there is an answer.  I've been working on this issue for 6 months and intensely the last three weeks.  Thank you in advance.
0
Comment
Question by:atljarman
  • 2
  • 2
4 Comments
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40466483
Why do you need to reinvent the wheel? Just enforce the password policy in the SQL Server for the logins you want
SQLPasswordPolicy.PNGand then in the Local Security Policy (Start > Control Panel > Administrative Tools > Local Security Policy) adjust the policies as you need:
LocalPasswordPolicy.PNG
0
 

Author Comment

by:atljarman
ID: 40466503
Ok.  So the user names and passwords are stored in tables that are accessed and updated by .net.  I think that is different than sql server logon user and passwords.  I think your recpmmendation is kob th latter, correct?  Thank you for trying to help.
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 40466509
Aren't SQL Server logins?
0
 

Author Comment

by:atljarman
ID: 40545716
These are ASP .Net Membership SQL Server database passwords - This was solved on another question but will award points even though it was answering a different question.   I don't think I was asking the right question.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Updating ms sql with special characters 8 23
BULK LOGGED - log full 9 13
Asp.net mvc 5 5 17
Achieve json result 2 29
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now