Re: RC4 encryption with PHP
| From: | bill | Date: | Wed, 06 Mar 2002 15:12:04 +0000 |
| Subject: | Re: RC4 encryption with PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17509@lists.php.net to get a copy of this message | ||
Might be late, but here's what I have working.
"Troy A. Delagardelle" wrote:
> I am trying to encrypt a credit card number using rc4 and php and then dump
> it into a mySql database. Does anyone have any sample code that allows me
> to do this??
>
> I found the Class.RC4Crypt algorithm and would like to use that. When I
> include the class.rc4crypt.php the page dies...
>
> Here is my code...
>
> // encrypt the credit card number here.
>
> include("class.rc4crypt.php");
>
> $pass = $whatever;
> $data = $cardInfo['number'];
> $case ='de';
$case should be 'en' for encrypting.
> $rc4 = new rc4crypt;
> $encrypt_CC = endecrypt($pass, $data, $case);
Use this:
$rc4 = new rc4crypt;
$encrypt_CC=$rc4->endecrypt($pass, $data, "$case");
$data="encrypted"; // don't leave it in memory
>
>
> then I will send $encrypt_CC to the DB..
>
> Any help would be greatly appreciated..thx Troy