Thread: Suggestion about managing users and password

  1. #1
    Lost in the C ZaC's Avatar
    Join Date
    Jun 2008
    Location
    Italy
    Posts
    47

    Question Suggestion about managing users and password

    Hello evrybody!
    I'm coding a server in C in wich a client could autenticate himself or not.
    Username and password are sotred in a binary file with a fixed format (16 bytes for the user name, 16 bytes for the password).
    What is the best way to manage the autentication?
    A- to load the U&P file in a sorted array of structure usrNpsw_t and than to implement a binary search.
    B- to search in the binary file the username evrytime someone try to autenticate?
    C- something else i didn't think
    Thanks for any kind of suggestion
    ZaC

    PS: sorry for my bad english. I hope my trouble is clear
    Last edited by ZaC; 06-21-2008 at 04:53 AM.

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    This is one of those things that depend upon several factors.

    If authing will happen often, and if the user list is short, store the entire thing in memory in some sort of smart data structure (ie. hashing sounds good for a lookup) and go from there.

  3. #3
    Lost in the C ZaC's Avatar
    Join Date
    Jun 2008
    Location
    Italy
    Posts
    47
    thank you, MacGyver

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Access other user's documents...
    By Queatrix in forum Windows Programming
    Replies: 3
    Last Post: 12-03-2006, 10:55 AM
  2. Yahoo's sign-in seal technology
    By George2 in forum Tech Board
    Replies: 12
    Last Post: 09-21-2006, 07:29 AM
  3. How to create login and password?
    By sherwi in forum C Programming
    Replies: 10
    Last Post: 04-11-2006, 09:54 AM
  4. How to check somebody's password?
    By marinus in forum Linux Programming
    Replies: 8
    Last Post: 09-10-2005, 10:17 AM
  5. WinXP password expiration
    By afreedboy in forum Tech Board
    Replies: 4
    Last Post: 01-20-2004, 04:12 PM