473,386 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Asymmetric Encryption in PHP?

Is there a way to do asymmetric encryption purely in PHP?

Not for e-mail...could care less. But for credit card number processing, if
the bookkeeper could have a password she typed in every time she ran a batch
to unencrypt credit card numbers AND that number was not stored anywhere on
the webserver, several clients would be much less worried :>)

This is implying of course the numbers are encrypted on the server when they
are initially inserted into the database using a key on the server a hacker
could find with enough looking.

tia,
John
in Houston
Jul 17 '05 #1
6 4570
Tex John <jo**@logontexas.com> wrote:
Is there a way to do asymmetric encryption purely in PHP?


Define purely PHP.

Is http://nl3.php.net/openssl pure enough? Or somehting like
http://www.edsko.net/phpsource.php?f...ojects/rsa.php ?

Jul 17 '05 #2
Well, I'll loosen that up and say "not require a recompile of php or apache"
to get gpg or pgp to work and "not use an exec or system call"

John
Daniel Tryba" <pa**********@invalid.tryba.nl> wrote in message
news:42*********************@news6.xs4all.nl...
Tex John <jo**@logontexas.com> wrote:
Is there a way to do asymmetric encryption purely in PHP?


Define purely PHP.

Is http://nl3.php.net/openssl pure enough? Or somehting like
http://www.edsko.net/phpsource.php?f...ojects/rsa.php ?

Jul 17 '05 #3
Tex John <jo**@logontexas.com> wrote:

Please don't TOFU
Well, I'll loosen that up and say "not require a recompile of php or apache"
to get gpg or pgp to work and "not use an exec or system call"


Then what is you php/apache config?

Jul 17 '05 #4
1) I don't eat tofu so explain and I'll leave it out of my posts, too

2) I work for clients that have various configs. Almost all at least lease
their own boxes, but only one has the box actually at his location. So it
varies...and getting recompiles done can be problematic.

John
"Daniel Tryba" <pa**********@invalid.tryba.nl> wrote in message
news:42*********************@news6.xs4all.nl...
Tex John <jo**@logontexas.com> wrote:

Please don't TOFU
Well, I'll loosen that up and say "not require a recompile of php or apache" to get gpg or pgp to work and "not use an exec or system call"


Then what is you php/apache config?

Jul 17 '05 #5
In article <VD******************@tornado.texas.rr.com>,
"Tex John" <jo**@logontexas.com> wrote:
1) I don't eat tofu so explain and I'll leave it out of my posts, too

2) I work for clients that have various configs. Almost all at least lease
their own boxes, but only one has the box actually at his location. So it
varies...and getting recompiles done can be problematic.

John
"Daniel Tryba" <pa**********@invalid.tryba.nl> wrote in message
news:42*********************@news6.xs4all.nl...
Tex John <jo**@logontexas.com> wrote:

Please don't TOFU
Well, I'll loosen that up and say "not require a recompile of php or apache" to get gpg or pgp to work and "not use an exec or system call"


Then what is you php/apache config?


TOFU == "Text Over Full Quote Under" i.e. "Don't top post":

Why Top Posting is bad:

http://mailformat.dan.info/quoting/top-posting.html

Primer on Usenet posting customs in news groups
http://members.fortunecity.com/nnqweb/nquote.html

Bottom vs. top posting and quotation style on Usenet
http://www.cs.tut.fi/~jkorpela/usenet/brox.html

Why bottom-posting is better than top-posting
http://www.caliburn.nl/topposting.html

+What do you mean "my reply is upside-down"?
http://www.i-hate-computers.demon.co.uk/

The advantages of usenet's quoting conventions
http://homepage.ntlworld.com/g.mccau...ks/uquote.html

Why should I place my response below the quoted text?
http://allmyfaqs.com/cgi-bin/wiki.pl...bottom-posting

Quoting Style in Newsgroup Postings
http://www.xs4all.nl/%7ewijnands/nnq/nquote.html

[now back to your question]

You could "roll your own" simple encryption? It's easy enough to
something like XOR'ing the consecutive bytes (repeated as needed to pad)
of the password string with the clear text. Store the MD5 checksum of
the password for comparing for validity before decrypting. It's a
two-way algorithm. No need to recompile anything and can be ported.

Or if coding isn't in your skill set, try the various php libraries
around. http://www.phpclasses.org comes to mind. They have a bunch of
stuff.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #6
"Tex John" <jo**@logontexas.com> wrote in message
news:3T******************@tornado.texas.rr.com...
Is there a way to do asymmetric encryption purely in PHP?

Not for e-mail...could care less. But for credit card number processing, if the bookkeeper could have a password she typed in every time she ran a batch to unencrypt credit card numbers AND that number was not stored anywhere on the webserver, several clients would be much less worried :>)

This is implying of course the numbers are encrypted on the server when they are initially inserted into the database using a key on the server a hacker could find with enough looking.

tia,
John
in Houston


Don't know if anyone has ported RSA to pure PHP. I remember there was a guy
(insane?) who implemented RSA in Javascript. Since Javascript doesn't do
anything that PHP can't, you should have no problem porting it.
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Arpan | last post by:
How to decrypt a message using Asymmetric Algorithm (RSA Crypto Service provider) using .Net. I have successfully sent an encrypted message using recepient's public key but dont know how to...
13
by: Andy Chau | last post by:
I try to use RSA to implement the following scheme but wasn't sucessful. Sever encrypt a message using a public key, the client decrpyt the message using a private key. I don't want the client...
2
by: Paul Fi | last post by:
I have this encryption scheme that I want to implement: I have an authentication server, which takes clients' credentials to complete authentication but first I have to encrypt the credentials, I...
1
by: Bart | last post by:
Dear all, I would like to encrypt a large amount of data by using public/private keys, but I read on MSDN: "Symmetric encryption is performed on streams and is therefore useful to encrypt large...
0
by: ddnash | last post by:
We are installing an application that requires access to the ms-sql-m protocol (UDP/1434) as well as the data port (TCP/1433). The SQL Server we are using is part of an N+1 cluster. The issue is...
4
by: pintu | last post by:
Hello everybody.. I hav some confusion regarding asymmetric encryption.As asymmetric encryption it there is one private key and one public key.So any data is encrypted using private key and the...
3
by: dfa_geko | last post by:
Hi All, I had a question about encrypting and decrypting XML files using asymmetric keys. I copied some sample code from MSDN, here are the samples: ...
3
by: Bruce | last post by:
How can I encrypt strings using an asymmetric key? I want to encrypt short strings (credit card numbers, etc.) and save the encrypted strings into a database. When accessing the data (i.e. the...
0
by: steven acer | last post by:
Hi, i'm trying to use the .NET cryptography API to encrypt XML data and move XML files between computers. i'm using asymmetric keys to encrypt the xml tag data with the receiver's public key, then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.