Encryption in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
everurssantosh
Forum Newbie
Posts: 13
Joined: Wed Jun 25, 2008 10:26 am

Encryption in PHP

Post 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
User avatar
zplits
Forum Contributor
Posts: 158
Joined: Sun Aug 03, 2008 8:59 pm

Re: Encryption in PHP

Post 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)
User avatar
starram
Forum Commoner
Posts: 58
Joined: Thu Apr 10, 2008 1:27 am
Location: India
Contact:

Re: Encryption in PHP

Post 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.
Post Reply