Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 539603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:09:11+00:00 2026-05-13T10:09:11+00:00

I’m working on a very small form that accepts credit card numbers, which will

  • 0

I’m working on a very small form that accepts credit card numbers, which will be cleaned out shortly thereafter. For the time they exist in the database, I’d like them to exist in a comfortable state of encryption. Unfortunately, in my many years of web-development, programming, and database-development, I’ve not once had the opportunity to educate myself in the area of encryption.

Is there are relatively easy-to-implement method of encrypting credit card numbers that I can implement quickly? A set of functions, class, anything at all that will get the job done, and done well? I am taking this opportunity to educate myself on the issue, but due to time-sensitivity, more than just a nudge in the right direction is requested.

Language: PHP / Storage: MySQL

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:09:11+00:00Added an answer on May 13, 2026 at 10:09 am

    One of the best ways is to simply use MySQL for the encryption / decryption. See these functions:

    http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html

    However, keep in mind that while this will protect you against people who may find a way to read your database, it will not protect against someone who owns the server. That’s because the decryption key is present on the server.

    All in all, it’s a huge boost. True security would come from public key encryption and offline decryption with a secure private key (eg. different server).


    As an example:

    INSERT INTO BillingInfo 
    SET CCard = AES_ENCRYPT('4111...', 'super-secret-key')
    ...
    

    and

    SELECT 
    AES_DECRYPT(CCard, 'super-secret-key') 
    ...
    

    The specific function is documented here:
    http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html#function_aes-encrypt

    For more information on AES, please see:
    http://en.wikipedia.org/wiki/Advanced_Encryption_Standard


    For maximum security in your environment, I suggest you store the key in a PHP constant. It’s less likely to get divulged at runtime that way (minor detail).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.