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

  • SEARCH
  • Home
  • 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 6543057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:18:02+00:00 2026-05-25T11:18:02+00:00

I have a column in my database that stores a credit card number. After

  • 0

I have a column in my database that stores a credit card number. After keeping it in the database for about two weeks, I want to be able to run a query to update all of the credit card entries and mask them – only showing the last four digits. So far I have been unsuccessful at finding a way to go about this – what if the credit card numbers vary in length? It would be better if I could mask the first 12 digits unless it starts with a 3, then mask only the first 11.

  • 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-25T11:18:02+00:00Added an answer on May 25, 2026 at 11:18 am

    You have to restructure your handling of payment (credit) card data, and immediately. Otherwise, your company could lose the ability to process payment cards, and you’ll then probably get fired. And if these plain-text numbers get compromised by an un-authorized source …

    First, you’ll want to encrypt your payment card names, numbers, and expiration dates. Then, you’ll want to take a database backup, put it on tape, and get it off-site. Then, purge all existing database backups, because these contain plain-text credit card numbers – a big no-no according to the Payment Card Industry.

    The safest thing to do would be to store the four right-most digits in another encrypted column in your table. Then, you only need to select this field, and decrypt it on the client end (remember, you have to make sure payment card numbers are encrypted while going “over the wire” [a.k.a. your LAN or WAN or internet connection]). Display the number as “Account ending in ####” or something similar.

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

Sidebar

Related Questions

I have a certain column in a table that stores a number. I want
I have a column in my database that is typed double and I want
So we have a database column that can contain just about anything. Unicode, numbers,
I have a column in a SQL server database that stores numeric values. The
I have a column in my database that stores images that are links, when
I want to create counters in MySQL database that stores the number of views
i have a column in database that stores a range of user ages, like
I have a forum database that stores forum information in a single column. The
I have a database table column that stores urls of a persons website. This
I have a database column that contains the contents of a file. I'm converting

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.