Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

coding help with decrypt

Status
Not open for further replies.

bicyleman9008

IS-IT--Management
May 19, 2005
30
I have a database in which the credit card information is encrpyted.
I need to export the data to spreadsheet, save on a local pc & and decrypt the encrypted fields.

Here is the encrypt and decrypt code for the CC holder's name.
The table name is "orders"

How would I export the field "cc-holdername" to a spread sheet and decrypt it at the same time?

// *****************************************************************************
// Purpose encrypts cc_holdername field ( see ORDERS_TABLE in database_structure.xml )
// Inputs
// Remarks
// Returns
function cryptCCHoldernameCrypt( $cc_holdername, $key )
{
return base64_encode( $cc_holdername );
}


// *****************************************************************************
// Purpose decrypts cc_holdername field ( see ORDERS_TABLE in database_structure.xml )
// Inputs
// Remarks
// Returns
function cryptCCHoldernameDeCrypt( $cifer, $key )
{
return base64_decode( $cifer );
}
 
For the record, do you understand the base64 is not an encryption algorithm but rather a coding algorithm? That the data coded with base64_encode() is no more protected than having it written out as plaintext?



Want the best answers? Ask the best questions! TANSTAAFL!
 
No, I was not aware of that. This is not a program I wrote. Its part of a stock e commerce system.

I still need to know how to decrypt it, however.
 
Again, you're not decrypting, you're decoding. Your data is no more encrypted than had it been converted into Morse code.

This code is using base64 to supposedly secure client data? Which stock e-commerce program is this?



Anyway, to your question.

My answer is, "Insufficient data for a meaningful answer".

Given that I don't know what your database backend is, I can only give general advice:
[ol][li]Fetch the data from the database (for details on this, check the PHP online manual (link) section appropriate to your database[/li][li]run that value through the function you've listed[/li][li]output the value as XML[/li][li]use header functions to get a spreadsheet program to deal with this on the client site (look for "Content-disposition" on this page: )[/li][/ol]



Want the best answers? Ask the best questions! TANSTAAFL!
 
Out of curiosity, does your installation have a function defined named "cryptCCNumberCrypt"? If so, what is the definition of that function?



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top