UI apps networking?

Discussion in 'Programming' started by gigawert, Jul 19, 2017.

  1. Funky7Monkey

    Funky7Monkey
    Expand Collapse

    Joined:
    Oct 12, 2014
    Messages:
    977
    Woops, Everything you need to know regarding C#: https://docs.microsoft.com/en-us/dotnet/csharp/csharp
     
  2. Spaceballs the Username

    Spaceballs the Username
    Expand Collapse

    Joined:
    Oct 13, 2015
    Messages:
    568
    Can we all stop being so mean for once? The only way for people to learn is to TEACH them.

    @gigawert, look up hashing functions for your language of choice. Make sure the hashing is done on the server, not the client. Below is the general flow of how storing and fetching passwords should be like:

    1. User enters ID and Password
    2. ID and Password are sent to the server, preferably over an encrypted connection, such as HTTPS
    3. Password is hashed using your favorite language's appropriate hashing function (look them up, there are several, some are more secure than others). Make sure you use the same hash function you used to store the password in the first place.
    4. Use the ID to fetch the related stored hash (SELECT hashedPassword FROM users WHERE id = '$user')
    5. If the hashes match, then return a successful login session ID (languages like php have their own sessionID system, if your language doesn't have one, either look for a session library or make your own that generates random session strings, DON'T RETURN THE USERNAME as a hacker can easily fake logging in as someone else), otherwise reject and report nondescriptive error (Invalid login, please try again)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice