in reply to Re^5: encrypt/decrypt string
in thread encrypt/decrypt string

I don't have to maintain a table. Also, it's not about the sessions. URL given to user, should be fixed for lifetime, based on login. Also, on decryption, I need to get the 'login' info back.
--Artist

Replies are listed 'Best First'.
Re^7: encrypt/decrypt string
by driver8 (Scribe) on Oct 19, 2006 at 22:50 UTC
    Artist, what they are saying is: if you want the login info to be secure, why not just use a random string or number and link it to that login on the server side? If you don't really care about it being secure, why not just send the login unencrypted? Personally, I still can't see what you want to accomplish by encrypting.

    -driver8
      By encrypting the login, people cannot forge logins to hack the system.
      --Artist
        1. ...?id=mylogin
          attacker knows other users login or guesses it and can easily impersonate as that user.
        2. ...?id=myloginecrypted
          attacker knows other users login and can deduce the encoding/encrpytion sceme (e.g. by deriving from his own login->loginencrypted; i.e. "plain text attack"). One more hurdle compared to (1), but not really that harder.
        3. ...?id=randomtokenmatchedbyservertouser
          Here there is no encryption to guess. Attacker actually has to get hold of the token for the user he wants to impersonate (Which works for (2) too, of course)
        Seems you want to avoid (1) by choosing (2), which is not really an improvement IMHO. The alternative (3), proposed by others in this thread, is far "safer" with respect to your goal.