Jump to content

Best practice for encrypting passwords between js and php


anonymous75178

Recommended Posts

I'm creating a registration form using AJAX. My question is, if I'm dealing with passwords, when is the best time to encrypt?

 

1. Do I send the password without encryption to the php file then encrypt it?

2. Do I encrypt the password using JS then submit to the php file?

3. Should I do something else?

Link to comment
Share on other sites

I was told it is useless to use a JS function to encrypt passwords since it can be decrypted as easily as it can be encrypted at all times. Visitors have access to your scripts at all times. You could use a secure 2-way encryption algorithm but it is complicated. Also, users can always disable JS so you MUST ecrypt server-side (for example before you verify against a database entry).

 

Off course, anyone with better understanding can correct what I claim here.

good luck

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.