php - Using password as part of encryption key in Mobile - Server communication -


I am currently working on a mobile app that has a web service developed in PHP. One thing we want to ensure is that the user data is safe in every way possible

After careful evaluation, we have decided to use all the things related to encryption. This is in addition to the HTTPS connection. The current process is of the following type (login example):

  1. The library on iOS uses a key to encrypt the password before sending it to the server.
  2. The server then stores it's encrypted password on the database.
  3. While re-ethnoboting, the app sends back the password (again encrypted with the steady key) and the server decrypts it (this means the server also has an encryption key), login Confirms and sends back the login key (encrypted with the same static key) to the client.
  4. The request for each request depends on the encrypted login and username for authentication of the validity of the username and login session.

    I believe the above system is inaccurate due to the STATIC encryption key and because the key is available on both the server and the client.

    What we need to do is by dynamically merge raw passwords with the STATIC encryption key by dynamic encryption keys. This will make the encryption key for each user, but this means that the server will not have any information about the key.

    Can anyone help me with this? It is important for the server to know that other user data will also be encrypted and decrypted based on this key. What steps should I take to make the system more secure? Any code snippet or specific reference link for the server-mobile customer will also. I know that there are so many tutorials, but most clients do not start the client based on the web and resume.

    PS: Sorry for such a long post.

    I would hardly use it to authenticate the OATH2 token, but if you do it in your own way Want ...

    A salty hash is used to secure the password. Consider the following as a basic example of a hashing password with salt, and keep in mind that it is not cryptographic safe.

    shAResult = SHA1 (16 bytes Random salt | "p @ Ssword ")

    Basics: The server stores shaResult Your app generated a salt value when the user types in their password, then you add it to the stored salt, Do the hash, and take it for verification They send it to the server. In fact it is no longer necessary to encrypt it on the server. The HTTPS connection should handle it.

    Good cryptographic password hashing has been briefly described in the description that they recommend using the following:

    1. Prepared the salt using cryptographic secure pseudo Should be - Random Number Generator (CSPRNG). Recommended CSPRNGs are provided in the link for many programming / scripting languages.
    2. Salt should be unique per-user per-password Every time a user creates an account or changes their password, the password must be washed using a new random salt. Do not reuse salt, salt should also be long, so that it is possible to be very salt. As a rule of thumb, at least make your salt as long as the output of the hash function should be kept with the hash in the user account table.
    3. Use a well-tested cryptographic hash algorithm, such as SHA256, SHA512, PEPMD, WHIRLPOOL, SHA3, etc.
    4. Use a slow hashing function that displays many iterations. Standard algorithms are included and.
    5. Use the key hashing algorithm.

      I repeat that the secure connection still needs to be used in conjunction with the above.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -