compliance · 2025-04-14 · 5 min read

Masking rules: what you may show on screen, in receipts and in logs

PCI allows at most the first six and last four digits to be displayed. Everything else must be hidden — on screens, receipts, emails, support tools and especially logs.

Show at most first six and last four.
Show at most first six and last four. — © Lima Santos · Pexels

Receipts, dashboards, support consoles and saved-card lists must never render a full PAN. PCI DSS Requirement 3.4 limits display to the first six and last four digits for staff who need them, and in practice consumer-facing screens show just the last four: •••• 4242.

Masking vs. truncation

  • Masking hides digits on display while the full value may still exist (encrypted) in a system that is in scope.
  • Truncation permanently removes digits before storage, so only 424242••••••4242 ever exists. Truncated data is out of scope — which is why most merchants store only what the tokenization provider returns: brand, last four, expiry.

Where full numbers leak by accident

  • Application and web-server logs capturing request bodies.
  • URLs and query strings (which then land in analytics, referrers and browser history).
  • Error-tracking payloads and crash reports.
  • Customer-support chat transcripts and screenshots.
  • Email receipts that print the number 'for reference'.
Mask on the server where possible. Client-side masking that receives the full number first still puts the full number in the browser's memory and network trace.

Note that the move to 8-digit IINs did not change the rule: six-plus-four remains the maximum. The PCI Security Standards Council FAQ addresses this specifically.

Never put a full PAN in logs, URLs or analytics.
Never put a full PAN in logs, URLs or analytics.

Keywords: PAN masking, first six last four, PCI DSS requirement 3.4, truncation, card number display, receipt masking

Frequently asked questions

How many digits of a credit card can be shown?

At most the first six and the last four. Customer-facing screens usually show only the last four.

Is showing the last four digits PCI compliant?

Yes. The last four alone are not considered sensitive and may be stored and displayed.

On this site

External references

Related articles

قواعد الإخفاء: ما يجوز عرضه على الشاشة وفي الإيصالات والسجلات — النسخة العربية

يسمح PCI بعرض أول ست خانات وآخر أربع على الأكثر. وكل ما سواها يجب إخفاؤه — على الشاشات والإيصالات والبريد وأدوات الدعم وخصوصًا السجلات.

يجب ألا تعرض الإيصالات ولوحات التحكم وأدوات الدعم وقوائم البطاقات المحفوظة رقم البطاقة كاملًا أبدًا. يحدّ المتطلب 3.4 من PCI DSS العرض بـأول ست وآخر أربع خانات للموظفين الذين يحتاجونها، وعمليًا تعرض شاشات المستهلك آخر أربع فقط: •••• 4242.

الإخفاء مقابل الاقتطاع

  • الإخفاء يحجب الخانات عند العرض بينما قد توجد القيمة الكاملة (مشفّرة) في نظام ضمن النطاق.
  • الاقتطاع يحذف الخانات نهائيًا قبل التخزين، فلا يوجد سوى 424242••••••4242. البيانات المقتطعة خارج النطاق — ولهذا يخزّن معظم التجار فقط ما يعيده مزوّد الترميز: العلامة وآخر أربع وتاريخ الانتهاء.

أين تتسرّب الأرقام الكاملة بالخطأ

  • سجلات التطبيق وخادم الويب التي تلتقط أجسام الطلبات.
  • الروابط وسلاسل الاستعلام (التي تصل بعدها إلى التحليلات والمُحيلات وسجل المتصفح).
  • حمولات تتبع الأخطاء وتقارير الأعطال.
  • نصوص دردشة دعم العملاء ولقطات الشاشة.
  • إيصالات البريد التي تطبع الرقم «للمرجع».
أخفِ على الخادم حيث أمكن. الإخفاء في جهة العميل الذي يستقبل الرقم كاملًا أولًا يضع الرقم الكامل في ذاكرة المتصفح وأثر الشبكة.

لاحظ أن الانتقال إلى IIN من 8 خانات لم يغيّر القاعدة: ست زائد أربع تبقى الحد الأقصى. أسئلة مجلس معايير أمن PCI الشائعة تعالج هذا تحديدًا.

أسئلة شائعة

كم خانة من بطاقة الائتمان يمكن عرضها؟

أول ست وآخر أربع على الأكثر. شاشات العملاء تعرض عادة آخر أربع فقط.

هل عرض آخر أربع خانات متوافق مع PCI؟

نعم. آخر أربع وحدها لا تُعدّ حساسة ويجوز تخزينها وعرضها.

Educational content — not legal or financial advice. Open the interactive Check Digit Lab →