PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 3rd, 2013, 06:48 AM
empieters empieters is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 empieters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 50 sec
Reputation Power: 0
PHP-Extension - Using Gnupg to encrypt credit card details

I know it is difficult to answer me when the questions to ask is not even simple. I will explain.

I have a provider where I run PHP. My boss needs to store credit card details in the database. But the English law requires them to be encrypted. I want to use gnupg to encrypt the credit card details.
Then I look on php.net and there is a function (among others) called gnupg_init(). This seems to provide all that I want. But when I use it it cannot find the function.
I also read that the gnupg library is available as a PECL. This PECL stuff is all new to me.
I just do not know what to do?
Do I download the library? I think so. But where do I place it?
Do I upload it next to my php programs on the server?
Do I have to change something in the php.ini file?

Can anybody give me an idea as to what I need to do? It is all a big riddle to me now.
Always keep in mind that I want to achieve the following:
- I receive credit card details automatically in my php program. This already works.
- I now store them in the database (already works) but I would like to encrypt them using gnupg before doing that. I know I need a public key from the person that will eventually decrypt it for this.

Not too much to ask I think. Should not be too difficult, but it is.

Reply With Quote
  #2  
Old January 3rd, 2013, 07:13 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,874 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 16 h 21 m 11 sec
Reputation Power: 581
This explains how to download and install PECL extensions.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #3  
Old January 3rd, 2013, 08:05 AM
empieters empieters is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 empieters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 50 sec
Reputation Power: 0
Hmm That might be very obvious for you, but it does not help me. I had already found this.
Can you give me some steps to take.
Do you think it possible what I want?

Reply With Quote
  #4  
Old January 3rd, 2013, 08:07 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,874 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 16 h 21 m 11 sec
Reputation Power: 581
Then I don't understand your question. What part of the installation instructions do you not understand? Quote the section and I'll try to explain.

Reply With Quote
  #5  
Old January 3rd, 2013, 08:38 AM
empieters empieters is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 empieters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 50 sec
Reputation Power: 0
That is the very problem.
I have no clue as to where to start.

I never installed a PECL and I do not know how.
I want to run the gnupg_* functions in PHP.
If I look at phpinfo(), I see no gnupg there.
Does that mean my provider does not offer this?
Or can I install it myself?

I take it that the provider does not like it when several users install this or is this normal behaviour?

Is it this I must run?
$ pecl install {package}

It is all so new to me.

Reply With Quote
  #6  
Old January 3rd, 2013, 08:45 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,874 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 16 h 21 m 11 sec
Reputation Power: 581
Start with the section titled "Downloading PECL extensions."

Reply With Quote
  #7  
Old January 3rd, 2013, 09:09 AM
empieters empieters is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 empieters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 50 sec
Reputation Power: 0
so I do the command line command:
pecl download gnupg

And that is enough?

Reply With Quote
  #8  
Old January 3rd, 2013, 09:17 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,874 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 16 h 21 m 11 sec
Reputation Power: 581
If you have the pecl command installed yes. That will download the file then you follow the next steps in the instructions. If you don't have the pecl command installed then install it first. How you install it depends on your OS.

Reply With Quote
  #9  
Old January 3rd, 2013, 09:43 AM
empieters empieters is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 empieters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 50 sec
Reputation Power: 0
I ran the command on the provider's server but it produced and error. Probably there is no pecl command there.

Reply With Quote
  #10  
Old January 3rd, 2013, 09:50 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,874 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 16 h 21 m 11 sec
Reputation Power: 581
If you don't own the server or have admin (sudo) privileges then it won't matter as you will not be able to install software anyway. If that is the case then you need to ask your systems admin to install it for you.

If that is not possible then you are going to have your work cut out for you. You will probably have to install GPG in your own workspace, and program your page to encrypt/decrypt the data as necessary with 'system' calls rather than PHP extensions.

Reply With Quote
  #11  
Old January 3rd, 2013, 09:54 AM
empieters empieters is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 empieters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 50 sec
Reputation Power: 0
I do not have rights on the server and I figured that was going to be the problem all along. I had hoped there was a PHP class that I could upload in my workspace and run from there.

I think I give up or maybe you have other ideas.
Thanks for you help
Eric from Spain

Reply With Quote
  #12  
Old January 3rd, 2013, 10:35 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,874 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 16 h 21 m 11 sec
Reputation Power: 581
As I suggested, you can install GPG in your own workspace and write the pages using 'system' to encrypt/decrypt the data.

Reply With Quote
  #13  
Old January 3rd, 2013, 06:58 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Click here for more information.
 
Join Date: Dec 2004
Posts: 7,931 E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 7 h 43 m 47 sec
Reputation Power: 6991
The mcrypt extension is a better way of doing this. There's a good chance that it is already installed on your host, but if it isn't, you won't be able to install it yourself.

There is a pure-PHP library called phpseclib that can perform RSA encryption. It will be slow, but you can use that as a fall back if mcrypt is not available.
__________________
PHP FAQ
How to program a basic, secure login system using PHP

Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #14  
Old January 4th, 2013, 03:01 AM
seeked seeked is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 7 seeked User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 52 sec
Reputation Power: 0
mcrypt...openssl

GnuPG is a fine product but for this, you may be better off using the PHP OpenSSL functions if you would like to do RSA encryption.

If you are looking for a solution for symmetrical encryption mcrypt would fit the bill.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-Extension - Using Gnupg to encrypt credit card details

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap