Page 1 of 1

Encryption in PHP

Posted: Fri Sep 05, 2008 1:12 am
by everurssantosh
Hi ,

I am facing problems in encryting text in PHP.

I am having an input form for the user to enter the password and a key for security. I am going to store those in database for future use. My site is SSL enabled too. I want to encrypt the password and store them in database. I will get those varriables to PHP for encryption only after the page is submitted to one more page.

My Concern is "To transmit the data through form post varriables from one page to another as plane text."
Is it safe to transmit the plane text (password and key) to the other page and then encrypt them and store in the database? :banghead:

I have also tried to encrypt the password in JavaScript and send it across to the other page. But in that page again I need to decrypt and encrypt in PHP and store in database.

I am really confused for this issue. Kindly Help.....

Thank you.
Santosh

Re: Encryption in PHP

Posted: Fri Sep 05, 2008 2:37 am
by zplits
Hi there! Please clarify what you want to do? If the user inputs into your textboxes, will it directly be save to your database?

Please be more specific, because if you post as specific as possible, surely, there will be a lot who'll help you.

Cheers 8)

Re: Encryption in PHP

Posted: Fri Sep 05, 2008 2:56 am
by starram
How about using AJAX?

On the form submission you can call a javascript function which will send value of input box to a php script. That PHP Script will return the encrypted value password.

U can store that encrypted value in your database easily.