When sending messages containing bank card or account numbers, the numbers are masked according to the rules described in this article.
Masking allows you to display only the first and last four digits of the card or account number and hide the remaining digits using the *
symbol.
Card Masking
The card number to be masked is considered to be a sequence of 14 to 19 digits without spaces, where the first digit is 3, 4, 5, 6 or 7, as well as a sequence of digits with separators in formats:
P-19
, P-18
, P-16
, P-15
, P-14
, P-4-4-4-6
, P-4-4-4-3-3
, P-8-10
, P-4-4-4-4
, P-4-8-4
, P-4-6-5
, P-4-6-4
, P-4-4-4-3
, P-4-4-4-4-2
A space and the following special characters are used as separators:
-
_
.
,
;
:
*
A digit in the format indicates the number of consecutive digits in the card number. For example:
- The format
P-14
can represent the number67090909091209
- The format
P-4-4-4-6
can represent the number3123_1234_1234_123456
Account Masking
The card number to be masked is considered to be a sequence of 20 to 21 digits without spaces, as well as a sequence of digits with separators in formats:
P-21
, P-20
, P-4-4-4-4-5
, P-4-4-4-4-4
, P-5-3-1-4-7
, P-5-3-1-4-8
A space and the following special characters are used as separators:
-
_
.
,
;
:
*
A digit in the format indicates the number of consecutive digits in the account number. For example:
- The format
P-20
can represent the number670909090912092233660
- The format
P-5-3-1-4-7
can represent the number12345*123*1*1234*1234567
Configuring Templates with Masking Formats
You can configure templates with masking formats in the configuration file, or by contacting technical support at support@edna.io.
Numbers are masked using templates that begin and end with a space or separators .
,
;
:
-
and are ordered by the length of the recognized text, from greater to lesser.
- 21 digits without separators. Example:
123456789012345678901
- 4 groups of digits with a space or separators
'
.
,
;
:
\
-
'
Format:P-5-3-4-8
. Example:12345-123-1234-12345678
- 5 groups of digits with a space or separators
'
.
,
;
:
\
-
'
Format:P-4-4-4-4-5
. Example:1234-1234-1234-1234-12345
- 20 digits without separators. Format:
P-20
. Example:12345678901234567890
- 5 groups of digits with a space or separators
'
.
,
;
:
\
-
'
Format:P
–4-4-4-4-4
. Example:1234-1234-1234-1234-1234
- 5 groups of digits with a space or separators
'
.
,
;
:
\
-
'
Format:P
–5-3-1-4-7
. Example:12345-123-1-1234-1234567
- 19 digits without separators, where the first digit is 3, 4, 5, 6 or 7
Format:P-19
. Example:3123456789012345678
- 18 digits without separators, where the first digit is 3, 4, 5, 6 or 7
Format:P-18
. Example:312345678901234567
- 4 groups of digits with a space or separators
'
.
,
;
:
\
-
'
, where the first digit is 3, 4, 5, 6 or 7
Format:P-4-4-4-6
. Example:1234-1234-1234-123456
- 5 groups of digits with a space or separators
'
.
,
;
:
\
-
'
, where the first digit is 3, 4, 5, 6 or 7
Format:P-4-4-4-3-3
. Example:1234-1234-1234-123-123
- 2 groups of digits with a space or separators
'
.
,
;
:
\
-
'
, where the first digit is 3, 4, 5, 6 or 7
Format:P-8-10
, Example:12345678-1234567890
- 5 groups of digits with a space or separators
'
.
,
;
:
\
-
'
, where the first digit is 3, 4, 5, 6 or 7
Format:4-4-4-4-2
. Example:1234-1234-1234-1234-12
- 16 digits without separators, where the first digit is 3, 4, 5, 6 or 7
Format:P-16
. Example:3123456789012345
- 4 groups of digits with a space or separators
'
.
,
;
:
\
-
'
, where the first digit is 3, 4, 5, 6 or 7
Format:P-4-4-4-4
. Example:1234-1234-1234-1234
- 3 groups of digits with a space or separators
'
.
,
;
:
\
-
'
, where the first digit is 3, 4, 5, 6 or 7
Format:P-4-8-4
. Example:1234-12341234-1234
- 15 digits without separators, where the first digit is 3, 4, 5, 6 or 7
Format:P-15
. Example:312345678901234
- 4 groups of digits with a space or separators
'
.
,
;
:
\
-
'
, where the first digit is 3, 4, 5, 6 or 7
Format:P-4-4-4-3
. Example:1234-1234-1234-123
- 3 groups of digits with a space or separators
'
.
,
;
:
\
-
'
, where the first digit is 3, 4, 5, 6 or 7
Format:P-4-6-5
. Example:1234-123456-12345
- 14 digits without separators, where the first digit is 3, 4, 5, 6 or 7
Format:P-14
. Example:31234567890123
- 3 groups of digits with a space or separators
'
.
,
;
:
\
-
_
*
'
, where the first digit is 3, 4, 5, 6 or 7
Format:P-4-6-4
. Example:1234-123412-1234
Masking Peculiarities
- When the agent sends the card or account number to the customer, there will be a hidden number in the agent’s automated workplace and in the customer’s chat. For example, a sent 16-digit number can be displayed as
3123********3123
. - When the customer sends the card or account number to the agent, the number will only be hidden in the agent’s automated workplace. To also hide the number in the customer’s chat, refresh the page from the WebSDK or the Android or iOS application.
Numbers in other formats or with other separators are not hidden.