IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to mask Sensitive data?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manyamtej

New User


Joined: 14 Sep 2007
Posts: 3
Location: Bangalore

PostPosted: Thu Feb 12, 2009 8:01 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Feb 12, 2009 8:11 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Feb 12, 2009 8:37 pm
Reply with quote

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
View user's profile Send private message
manyamtej

New User


Joined: 14 Sep 2007
Posts: 3
Location: Bangalore

PostPosted: Sat Feb 14, 2009 1:11 pm
Reply with quote

thank u all for the suggestions
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top