compliance · 2025-03-31 · 6 min read

Tokenization: why your server should never see a PAN

Modern checkouts swap the card number for a meaningless token at the edge. It shrinks compliance scope, limits breach impact and keeps subscriptions working when cards are reissued.

Swap the PAN for a token at the edge.
Swap the PAN for a token at the edge. — © Ann Hannes · Pexels

A tokenization service receives card data directly from the browser, stores it in a hardened vault, and returns a token — an opaque identifier that is useless outside that vault. Your systems keep only the token. Combined with hosted fields, this is what lets a merchant qualify for the lightest PCI DSS self-assessment.

Two kinds of token

  • PSP (vault) tokens — issued by your payment provider (Stripe's tok_…/pm_…, Braintree nonces, Adyen recurring details). Scoped to that provider; see Stripe's token API.
  • Network tokens — issued by Visa, Mastercard or Amex themselves, bound to a merchant and device. They survive card reissues and typically earn higher authorization rates.

What tokenization buys you

  • A breach of your database exposes no card numbers.
  • PCI scope collapses to the payment page and token handling.
  • Recurring charges work without re-collecting details — and with account-updater services, without interruption when the physical card expires.
  • The CVV is never retained, satisfying the hard rule against storing it.

Tokenization is not encryption

Encrypted data can be decrypted with the key; a token has no mathematical relationship to the PAN. That distinction is why regulators treat tokens as out of scope. The Wikipedia article) covers the formal model.

Display-wise you still need the last four digits and brand for the customer's saved-card list — the provider returns those alongside the token, so you never need the full PAN. Follow the masking rules when showing them.

A token is useless outside its vault.
A token is useless outside its vault.

Keywords: tokenization, payment token, network token, vault, PCI scope reduction, card on file, account updater

Frequently asked questions

Is a payment token the same as an encrypted card number?

No. Encryption is reversible with a key; a token is a random reference with no mathematical link to the PAN.

What is a network token?

A token issued by the card network (Visa, Mastercard, Amex) rather than your PSP, bound to your merchant ID and resilient to card reissues.

On this site

External references

Related articles

الترميز: لماذا يجب ألا يرى خادمك رقم البطاقة أبدًا — النسخة العربية

تستبدل صفحات الدفع الحديثة رقم البطاقة برمز لا معنى له عند الحافة. وهذا يقلّص نطاق الامتثال ويحدّ من أثر الاختراق ويُبقي الاشتراكات تعمل عند إعادة إصدار البطاقات.

تستقبل خدمة الترميز بيانات البطاقة من المتصفح مباشرة، وتخزّنها في خزنة محصّنة، وتعيد رمزًا — معرّفًا معتمًا عديم الفائدة خارج تلك الخزنة. تحتفظ أنظمتك بالرمز فقط. ومع الحقول المستضافة، هذا ما يتيح للتاجر التأهل لأخف تقييم ذاتي في PCI DSS.

نوعان من الرموز

  • رموز مزوّد الدفع (الخزنة) — يصدرها مزوّدك (‏tok_…/pm_… لدى Stripe، وnonces في Braintree، وتفاصيل التكرار في Adyen). محصورة في ذلك المزوّد؛ انظر واجهة رموز Stripe.
  • رموز الشبكة — تصدرها فيزا أو ماستركارد أو أمكس نفسها، مرتبطة بتاجر وجهاز. تصمد أمام إعادة إصدار البطاقة وتحقق عادة معدلات تفويض أعلى.

ما الذي يمنحك إياه الترميز

  • اختراق قاعدة بياناتك لا يكشف أي أرقام بطاقات.
  • ينكمش نطاق PCI إلى صفحة الدفع ومعالجة الرموز.
  • تعمل الرسوم المتكررة دون إعادة جمع البيانات — ومع خدمات محدّث الحساب، دون انقطاع عند انتهاء البطاقة المادية.
  • لا يُحتفظ بـCVV أبدًا، بما يلبّي القاعدة الصارمة ضد تخزينه.

الترميز ليس تشفيرًا

البيانات المشفّرة يمكن فك تشفيرها بالمفتاح؛ أما الرمز فلا تربطه أي علاقة رياضية برقم البطاقة. هذا الفارق هو سبب اعتبار الجهات التنظيمية الرموز خارج النطاق. مقالة ويكيبيديا) تغطي النموذج الرسمي.

من ناحية العرض ما زلت تحتاج آخر أربع خانات والعلامة لقائمة البطاقات المحفوظة لدى العميل — ويعيدها المزوّد مع الرمز، فلا تحتاج أبدًا إلى رقم البطاقة الكامل. اتبع قواعد الإخفاء عند عرضها.

أسئلة شائعة

هل رمز الدفع هو نفسه رقم البطاقة المشفّر؟

لا. التشفير عكوس بالمفتاح؛ أما الرمز فمرجع عشوائي لا رابط رياضيًا بينه وبين رقم البطاقة.

ما هو رمز الشبكة؟

رمز تصدره شبكة البطاقات (فيزا أو ماستركارد أو أمكس) بدل مزوّد الدفع، مرتبط بمعرّف تاجرك وصامد أمام إعادة إصدار البطاقة.

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