Encrypt/Decrypt Data using 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
coder500
Forum Newbie
Posts: 20
Joined: Fri Jul 25, 2008 10:24 am
Location: Singapore

Encrypt/Decrypt Data using php

Post by coder500 »

Is there any way to encrypt information like email id,names, and payment information entered by the visitors and store them into database?

I want a method to download the data also?

Is it possible?

Any suggestions/help?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Encrypt/Decrypt Data using php

Post by jaoudestudios »

Encryption is a huge topic!

To encrypt id, email, password etc is one thing but to encrypt payment details is another.

If you are just starting to use encryption I would not store payment details. Use paypal or something, where it takes care of payment details for you!

There are many times of encryption methods and payment details requires the latest one with the highest encryption and payment details should be stored in a different database to the rest of the information on another server with SSL between the two and SSL for the website. Trust me leave payment details to another company that specialise in this otherwise you make get yourself into a lot of trouble if you loose this information.
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Encrypt/Decrypt Data using php

Post by Apollo »

You can encrypt and decrypt with PHP's mcrypt_encrypt and mcrypt_decrypt functions. If you only intend to store encrypted stuff in a database, you can also use MySQL's AES_ENCRYPT function.

But like jaoudestudios says: if you're new to this, better don't store any payment information (as in credit card numbers 'n stuff) at all.
coder500
Forum Newbie
Posts: 20
Joined: Fri Jul 25, 2008 10:24 am
Location: Singapore

Re: Encrypt/Decrypt Data using php

Post by coder500 »

Thanks for the reply.
Post Reply