Is it safe to use session to transfer password?

Discussion in 'C#' started by Johnvaam, Mar 7, 2007.

  1. #1
    Hi all,
    I want to create an asp website and allow user to register as member. But I have question about the password security:
    1.) Is it safe to use the "Session" command to transfer password and save inside the MS SQL? If not, what command should I use?
    2.) If "Session" command is safe to use, then should I add session.abandon to release all the data?
    3.) How to encrypt the password?
    4.) Any website have the complete asp programming example on how to create the member registration?

    Thanks.
     
    Johnvaam, Mar 7, 2007 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    when storing password in db: make sure to encrypt data. SQL Server has encryption built in, Session should be safe to carry around Token but NEVER store that data in cookies.
     
    ccoonen, Mar 7, 2007 IP
  3. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Memberships are handled and all built for you in asp.net 2005, I would look into that.
     
    ccoonen, Mar 7, 2007 IP
  4. Johnvaam

    Johnvaam Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you. CCoonen.
     
    Johnvaam, Mar 7, 2007 IP
  5. muncher

    muncher Member

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #5
    if you have to do it encrypt it and you should be fine
     
    muncher, Mar 18, 2007 IP
  6. Adi

    Adi Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    a. Session is a server side object - not a command. It "lives" inside the WEB server so it is safe to use it for keeping password.
    b. For saving the password in the database you can :
    1. Save it as plain test - this is bad.
    2. Save it encrypted - better then plain text but still bad since it can be decrypt.
    3. Save the hash result of the password - this is the best way (http://en.wikipedia.org/wiki/Hash_function)

    You should do it anyway when the user logs out to free server resources when they are not needed (they will be automatically
    freed when there is timeout)

    Don't encrypt - hash it

    http://www.codeproject.com/ - search it

    Notes:
    1. Don't implement anything by yourself - get a working library of code for it.
    2. If you are developing a commercial site you can't afford not to get a security expert to advice you.
    3. Use SSL for the pages which contains sensitive information
    4. Don't store the password in the session - store the login status and the user's information.
    5. Remember that if you don't use SSL for all your pages then the attacker can preform session hijacking attack
    Check out - http://en.wikipedia.org/wiki/Session_hijacking
     
    Adi, Mar 20, 2007 IP