View previous topic :: View next topic
|
Author |
Message |
manyamtej
New User
Joined: 14 Sep 2007 Posts: 3 Location: Bangalore
|
|
|
|
My requirement is to mask sensitive data such as bank account number.I want to display only last four digits.
For example ACCno 1234567890 should be displayed as ******7890 in output.
If possible please help me with piece of COBOL code. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
If the ACCno is all numeric:
Code: |
03 ACCno pic 9(10)
03 ACCmask.
05 filler pic x(6) value all '*'.
05 ACCend pic 9(4).
Move ACCno to ACCend.
display ACCmask. |
|
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Several of us on this board have just completed a mandated task named PCI/DSS (Payment Card Industry/Data Security Standard), which basically encrypts/decrypts credit-card numbers internally.
I would recommend that you suggest to your management, to acquire some type of "stealthy" method/package to disguise any type of critical data, such as bank account no's, credit-card no's, etc.
It is easy enough to display only the last four positions of a given number but more importantly, using an encryption/decryption method to keep "roaming eyes" away from the "clear" internal representation of critical data is essential and (IMHO) perhaps could be a mandate between your shop and a given customer. In addition, using an encryption/decryption method may be viewed by other potential customers as a proactive step in assuring data-integrity (a good selling point), unless of course, it's a mandate.
Here's one method/example (although there are others) to mask bytes 01-06 with asteriks and display bytes 07-10 -
Code: |
03 WS-ACCOUNT-NBR PIC 9(10) VALUE 1234567890.
03 WS-PATTERN PIC BBBBBB9999.
03 WS-PATTERN-X REDEFINES WS-PATTERN PIC X(10).
MOVE WS-ACCOUNT-NBR TO WS-PATTERN.
INSPECT WS-PATTERN-X CONVERTING SPACE TO '*'.
|
Regards, |
|
Back to top |
|
|
manyamtej
New User
Joined: 14 Sep 2007 Posts: 3 Location: Bangalore
|
|
|
|
thank u all for the suggestions |
|
Back to top |
|
|
|