Can I create ASP user validated website using existing MD5 passwords from SQL table?

I'm attempting to build a user authenticated site in Dreamweaver CS5 using an existing USERS table from another site.  The password field in the existing SQL table appears to be MD5 encoded.  How can I MD5 encode the form field (or the SQL query) so that it verifies MD5 to MD5?
Currently, it's comparing the form's plain text field to the MD5 encrypted password field in SQL.
I've built a simple login form using the following:
<form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
    <input name="username" type="text" id="username" accesskey="u" tabindex="1" /><input name="password" type="password" id="password" accesskey="p" tabindex="2" /><input name="submit" type="submit" value="submit" />
    </form>
With the stock Dreamweaver Log In User Server Behavior as follows:
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("username"))
If MM_valUsername <> "" Then
  Dim MM_fldUserAuthorization
  Dim MM_redirectLoginSuccess
  Dim MM_redirectLoginFailed
  Dim MM_loginSQL
  Dim MM_rsUser
  Dim MM_rsUser_cmd
  MM_fldUserAuthorization = ""
  MM_redirectLoginSuccess = "results.asp"
  MM_redirectLoginFailed = "error.html"
  MM_loginSQL = "SELECT user_name, password"
  If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
  MM_loginSQL = MM_loginSQL & " FROM dbo.users WHERE user_name = ? AND password = ?"
  Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
  MM_rsUser_cmd.ActiveConnection = MM_ADSX_STRING
  MM_rsUser_cmd.CommandText = MM_loginSQL
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 32, MM_valUsername) ' adVarChar
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 32, Request.Form("password")) ' adVarChar
  MM_rsUser_cmd.Prepared = true
  Set MM_rsUser = MM_rsUser_cmd.Execute
  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And false Then
      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
Please help!

unfortunately classic asp does not have a built in function for md5. what we used for our legacy sites is a javascript that hashes a string to MD5. here's the code we've used in the past http://pajhome.org.uk/crypt/md5/md5.html
your asp should have something like this...
<script language="jscript" src="path_to_js_file/md5.js" runat="server"></script>
<%
'hash the password
Dim md5password       ' md5password variable will hold the hashed text from form variable txtPassword
md5password = hex_md5(""&Request("txtPassword")&"")
' based on the code you posted...
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 32, md5password) ' adVarChar
%>

Similar Messages

  • I have multiple devices (imacs, lap tops and ipads) all connected to a NAS server.  Can I create a user for myself and one for my wife, and each have our own apple ID, and Itunes accounts, but all share the same media on NAS drives?

    I have multiple devices (iMacs, Lap tops, Ipads) all connected to a Nas Drive.  Can I create a user for myself and one for my wife and we each have our own apple ID's, Itunes etc, but share the same data on the hard drives?  So when she logs in, and sync's her ipads, they will sync with her stuff and when I do the same under my user account, on the same device, my ipads will sync with my stuff?

    You can share the same Apple ID for purchasng form the iTunes and app stores without any problems, but you should all used separate iCloud accounts with separate Apple IDs.  (You are not required to use the same ID for iCloud and other services as you do for the iTunes store.)  This will prevent you from ending up with merged data.  You should also use separate Apple IDs for iMessage and FaceTime or you will end up getting each other's text messages and FaceTime calls.
    This article may be of interest: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/, as well as this video: http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l.

  • Can't create new users after GroupWise is moved from NetWare to Linux

    Hi,
    I moved GroupWise (Version 6.5 SP 6, single domain and single office)
    from NetWare 6.5 server to SUSE Linux Enterprise server 9. It seems the
    GroupWise server is running oaky. Existing users are able to connect
    their mail box and send and receive messages. But I can't create new
    users on the GroupWise server.
    I used ConsoleOne installed on the Linux server to create new GroupWise
    users. It seemed that I was able to do it. The new users appear on the
    NDS and the GroupWise File IDs were assigned for these users. And I was
    able to add these new users to distribution lists. But the users DB
    files (userXXX.db) were not created under /grpwise/po/ofuser on the Linux
    server and they cannot connect to the server. Old users cannot find them
    in Novell GroupWise Address book.
    Does anyone how to fix the problem?
    Thanks in advance!
    Jinkang

    Hi,
    [email protected] wrote:
    >
    > Hi,
    >
    > I moved GroupWise (Version 6.5 SP 6, single domain and single office)
    > from NetWare 6.5 server to SUSE Linux Enterprise server 9. It seems the
    > GroupWise server is running oaky. Existing users are able to connect
    > their mail box and send and receive messages. But I can't create new
    > users on the GroupWise server.
    >
    > I used ConsoleOne installed on the Linux server to create new GroupWise
    > users. It seemed that I was able to do it. The new users appear on the
    > NDS and the GroupWise File IDs were assigned for these users. And I was
    > able to add these new users to distribution lists. But the users DB
    > files (userXXX.db) were not created under /grpwise/po/ofuser on the Linux
    > server and they cannot connect to the server. Old users cannot find them
    > in Novell GroupWise Address book.
    >
    > Does anyone how to fix the problem?
    This clearly sounds like your domain (which is the part of groupwise
    which you admin against) doesn't/can't talk to the postoffice, so the
    change you made (to the domain) does never get to the PO (which is where
    the addressbook of your other users come from, and is what is
    responsible for creating the user DB). This seems very likely to be
    caused by your move not being done properly, and old information (either
    path or IP address) for the PO still being in the domain and/or domain
    database.
    So how's the domain linked to the PO?
    CU,
    Massimo Rosen
    Novell Product Support Forum Sysop
    No emails please!
    http://www.cfc-it.de

  • E-recruiting: create internal user failture when using RCF_CREATE_USER

    Hi, experts
        When I create candidate and internal user in E-recuriting using report RCF_CREATE_USER, the system returns me a message: "I::000 Enter at least one number for the business partner" , and so i can't create the user successfully.
        Can anyone show me the solution?
        Thanks very much.
        Best Regards,
        qiuguo

    Hi
    just a thought.....it may not be creating a CP /BP....check your authorization.....hope this helps.....b/r

  • How can I create an csv/excel file using pl/sql and then sending that file

    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.

    968776 wrote:
    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.You are trying to do it at a wrong place..
    Whay do you want database (pl/sql) code to do these things?
    Anyhow, you may be interested in :
    {message:id=9360007}
    {message:id=9984244}

  • Can i create additional apple id's using the same email address for using multiple products with iCloud?

    can i create additional apple id's using the same email address for using multiple products with iCloud?

    Hi Anne,
    I'm pretty sure different eMail addies are needed for different Apple IDs.

  • How can i create an apple id without using a visa or credit card

    how can i create an apple id without using a visa or credit card

    Follow the directions here, EXACTLY:
    http://support.apple.com/kb/ht2534

  • How can I create a new entry without using LOV for foreign keys.

    Referring to TUHRA sample application based on HR database schema. JDeveloper 10.1.3.0.4
    How can I create a new employee without using LOV for the foreign key "job_id".
    On the first page I would like to choose the job_title from adf read-only table.
    After clicking on the "create new employee button" a creation form appears in which the job_id field is set with previous selection.
    Regards M.Winkler
    Edited by: user3541283 on 06.10.2008 03:44
    Edited by: user3541283 on 06.10.2008 03:50

    Hi,
    usually the foreign key is only set if the VO you select is dependent from a master. If e.g. you have DepartmentsVO1 that has an EmployeeVO3 as its nested VO, then creating a new instance of employees automatically add the foreign key. If you add EmployeesVO1, which is not dependent to DepartmensVO1, then the foreign key is not set. So if this is the case in THURA (keep in mind that this is not an Oracle demo but a sample used in a book about ADF) then all you need is to take the independent VO when building the new employee form.
    Frank

  • Can we create the Purchase order that using P&L account or just using account do not use cost center.

    Dear Experts,
    Could you please advise :
    1) Can we create the purchase order that using profit and loss account ? ( if yes , which kind of account assignment category we should use ?)
    2) How to create a purchase order for service charge .( just using GL account )
    Thanks & Best Regards,
    Watson

    Hi,
       May I know why you do not use cost center for consumption?
       You may create a new account assignment category in OME9 by copying K and maintain the cost center as optional. Please note that you have to maintain the item category blank and the account assignment category combination in OMG0. Now, you can use a GL account in PO which doesnt require a cost center assignment (in OBC4 against the field status group of the GL)
       You may use the same account assignment category created in the previous step with item category D, after you maintain the combination of the account assignment with item category D in OMG0.
        Please test the scenario and revert back.
    Regards,
    AKPT

  • Can we create multiple session in BDC using Call session?

    Hi Experts,
    Can we create  multiple sessions in BDC using Call Session?
    Scenario:
    Program has to upload 1 million records,so can we programmatically create multiple sessions such that after every 50thousand records we create a different session.
    For moment due to large number of records BDC DYNPRO and BDC Field are unable to hold the large number of records,due to which we get a Out of memory error.
    Thanks in advance.
    Shilpa

    Hi
    If ITAB is your table with the data to be transfered:
    Open the first session:
    CALL FUNCTION 'BDC_OPEN_GROUP'.........
    IF SY-SUBRC = 0.
      FL_OPEN = 'X'.
    ENDIF.
    LOOP AT ITAB.
    IF FL_OPEN = SPACE.
    Create new session
    CALL FUNCTION 'BDC_OPEN_GROUP'.........
    IF SY-SUBRC = 0.
       FL_OPEN = 'X'.
    ENDIF.
    ENDIF.
    Here elaborate your data and fill BDCDATA
    Insert the transaction:
    CALL FUNCTION 'BDC_INSERT'
    IF SY-SUBRC = 0.
      COUNT = COUNT + 1.
      IF COUNT = COUNT_MAX.
        COUNT = 0.
    Close the session
        IF FL_OPEN = 'X'.
          CALL BDC_CLOSE_GROUP
          IF SY-SUBRC = 0.
            FL_OPEN = SPACE.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDLOOP.
    Max

  • Error in installing BAM, can not create orabam user

    Hi all,
    I tried install Oracle BAM and always getting the same problem. Error at creating orabam user.
    Any idea?
    Afonso

    hi all
    having same problem
    i can cannot create orabam user
    my oracle home is set
    i have also set my path ahead of oracle home
    C:\OracleBAM\ClientForBAM\bin in environmental variable..
    i can login into my database as sysdba also
    but when screen goes to create ORABAM USER it gives me the error cannot create the user
    kindly help pls
    CHeers

  • Can you make a e-commerce website using dreamweaver?

    can you make a e-commerce website using dreamweaver?

    Sure, if you have the requisite coding skills.  Out of the box, DW has no such module.
    Best advice, use a 3rd party shopping cart like PayPal or Asecurecart.net. Or purchase a DW e-commerce extension like Cartweaver.  Or, use Business Catalyst to build your site (includes hosting & shopping cart module).
    Nancy O.

  • Can I create a secure log in using muse

    can I create a secure log in using adobe muse?

    Hi
    check this thread, Re: Can I create a login/password protection in Muse for a HTML5 page or two?

  • Can I create bookmarks on PDF document using stadard acrobat writer? or only using professional acrobat writer?

    can I create bookmarks on PDF document using stadard acrobat writer? or only using professional acrobat writer?

    Hi hagitl14083762,
    Bookmarking in available in both Acrobat Pro and Standard. You'll find instructions here: Adobe Acrobat X Standard * Create a bookmark (while written for Acrobat X, these instructions apply to Acrobat XI as well).
    Please let us know if you have additional questions.
    Best,
    Sara

  • Can any one tell me how to use EXISTS clause inplace of IN operator.

    Hi All,
    Can any one tell me how to use EXISTS clause AND (JC.EMPL_ID, JC.EMPL_RCD) inplace of IN operator.
    SELECT COUNT (1)
    FROM SYSADM.OHR_PERS_CURR PC
    , SYSADM.OHR_JOB_CURR JC
    WHERE PC.EMPL_ID = JC.EMPL_ID
    AND (JC.EMPL_ID, JC.EMPL_RCD) in (
    SELECT HS.EMPL_ID, HS.EMPL_RCD
    FROM SYSADM.HU_SCRTY_JOB HS, ODSHR.OHR_SCRTY_USER_CFG OS
    WHERE HS.HU_SCRTY_CFG_ID = OS.HU_SCRTY_CFG_ID
    AND OS.DB_LOGIN = USER)
    Thank you.

    SELECT COUNT (1)
    FROM SYSADM.OHR_PERS_CURR PC
    , SYSADM.OHR_JOB_CURR JC
    WHERE PC.EMPL_ID = JC.EMPL_ID
    AND EXISTS (
    SELECT null
    FROM SYSADM.HU_SCRTY_JOB HS, ODSHR.OHR_SCRTY_USER_CFG OS
    WHERE HS.HU_SCRTY_CFG_ID = OS.HU_SCRTY_CFG_ID
    AND OS.DB_LOGIN = USER
    AND HS.EMPL_ID = JS.EMPL_ID AND HS.EMPL_RCD = JC.EMPL_RCD)
    But why ?
    Rgds.

Maybe you are looking for