Facing Issues On IT

Search
Skip to content
  • Tutorials
  • Springboot & REST
  • Issues & Solutions
  • Sample Code
  • Interview Preparation
Mask

Mask Bank Account Number on Page

3 Jul 2019 Saurabh Gupta Leave a comment

Bank account number is unique number with in organization to track a particular personal detail that’s sensitive information and should be masked so that unauthorized persons will not misuse it.

Most of the banks have unique account numbers, varies from 9 digits to 18 digits. Most of the banks (67 out of 78) have included branch code as part of the account number structure.

For branch code, In India use different terms as IFSC code and in USA use as routing number.

In USA, combination of account number and routing number together is very sensitive if a person know about both account number and routing number can transfer someone’s complete checking account money.

See Also :

  • Log4j2: How to Mask Logs Personal/Confidential/SPI Information
  • How to Mask JSON Confidential/Personal Information in logs :JAVA
  • How to mask JAVA Object confidential/personal information in logs while Printing
  • How to MASK XML Confidential/Personal Data : JAVA
  • How to mask Personal/Confidential Information on web page

Account Number masking Example

Here considering, account number of length 10 digits. By masking will hide initial 6 digits and show only last 4 digits. For example, my account number is 1234567890 than after mask will display as XXXXXX7890.

original account numbermasked account number

HTML Changes

Refer attachment in download section for HTML.

Java Script/JQuery Changes

Copy below java script in your head section of page.

var originalVal;
$(document).ready(function()
{
       if($('#txtAC').val().length>0)
		 {
		 if($('#txtAC').val().indexOf("X")==-1)
			{
			  originalVal=$('#txtAC').val();
			}
		    maskAccountNumber(this);
		 }

	    $('#txtAC').blur( function(e)
		{
	    	if($('#txtAC').val().indexOf("X")==-1)
	    	{
	    	  originalVal=$('#txtAC').val();
	    	}
	    	 maskAccountNumber(this);
		});

		$('#txtAC').focus( function(e)
		{
			$(this).val(originalVal);
		});
});
function maskAccountNumber(regularAC)
{
	 var varlen =$(regularAC).val().length;
	 if(varlen > 10)
	 {
	 $("#error").text('Not Valid Accont Number.');
	 }
	 else
	 {
	 $("#error").text('');
	 var str = $(regularAC).val();

	 var mask = varlen > 0 ? varlen > 1 ? varlen > 2 ? varlen > 3 ? varlen > 4 ? varlen > 5 ?
	        'XXXXXX'+ str.substring(6)
          : 'XXXXX'
          : 'XXXX'
          : 'XXX'
          : 'XX'
          : 'X'
		  : '';
          $(regularAC).val(mask);
  	}
}

Note :
This masking example is created considering standard length of text size and formatting of text field, that can vary according to organizations. If your organization having different format and text size modify source code according to your need.
If you are facing any issue drop a comments will try to connect as soon as possible.

Download Source code

To download the source code of this example, click on below given download link. Mask Bank Account Number

References

  • https://www.rbi.org.in/scripts/PublicationReportDetails.aspx?ID=695
  • htps://en.wikipedia.org/wiki/International_Bank_Account_Number

Related Posts

Your Feedback Motivate Us

If our FacingIssuesOnIT Experts solutions guide you to resolve your issues and improve your knowledge. Please share your comments, like and subscribe to get notifications for our posts.

Happy Learning !!!

Share this post with others:

  • More
  • Tweet

Like this:

Like Loading...

Related

mask account numbermask bank account numberMask Credit Cardmask htmlmask routing numberMask SSNmasking on htmlmasking on jsp pagemasking on web page

Post navigation

Previous PostMask Driving License Number On Web PageNext PostMask Credit/Debit Card Number on Page

You must log in to post a comment.

Blogs By Category

Advertisements

Top Posts & Pages

  • [Solved] javax.crypto.AEADBadTagException: Tag mismatch
  • [Solved]: Maven Error "Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project XYZ: There are test failures."
  • [Solved] Java UnsupportedClassVersionError : Compiled by a more recent version of the Java Runtime (class file version X), this version of the Java Runtime only recognizes class file versions up to Y
  • [Solved] Spring Data JPA :QueryCreationException: Could not create query for public abstract method XYZ
  • [Solved] SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
Advertisements

Recommendations

  • Java: Coding & Review Best Practices
  • JDBC Coding Best Practices
  • Spring Boot + REST Tutorial
Advertisements

Interview Questions and Answers

  • Elasticsearch Interview Questions and Answers
  • Java: Interview Questions and Answers
  • JDBC Interview Questions And Answers
  • Spring Boot + REST Tutorial
  • [100+] Frequently Asked Java Program
Advertisements
Advertisements

“Learn From Others Experience"

Java Tutorial

Java Tutorial


Java :Overview and Setup
  • Java Overview
  • Java Evaluation
  • Environment Setup
  • Upgrade JDK in Eclipse
  • "Hello World" Program
  • Program Execution
  • Execution Steps
  • main() Variations
  • JIT,JDK,JRE,SDK,JVM

Java Keywords
Java Data Types
  • Primitive Type
  • Non-Primitive Type

Java Variable & Literals
Java Idnetifiers
Java Statements
  • Blocks
  • Empty Statements
  • Declaration Statements
  • Expression Statements
  • Control Flow Statement
    • Decision Making
      • if
      • if-else
      • if-else if
      • switch
    • Looping
      • for loop
      • while loop
      • do-while loop
      • for-each loop
    • Branching
      • break
      • continue
      • return
Reachability of Statements
Java Operators
  • Unary Operators
  • Arithmatic Operators
  • Relational Operators
  • Conditional Operators
  • Bitwise Shift Operators
  • Logical Operators
  • Assignment Operators
  • Instanceof Operators
  • Boolean Operators
  • Ternary Operators
  • Operators Precedence

Java Comments
Java Documentation
Java OOPS Concepts
  • Naming Convention
  • Java Object
  • Java Class
  • Object Cretaion Ways
  • Type of Classes
  • Constructor
  • static keyword
  • this keyword

Java Inheritance
  • Inheritance(IS-A)
  • Aggregation(HAS-A)
  • Aggregation Vs Composition
  • super keyword
  • Constructor Chaining

Java Polymorphism
  • Method Overloading
  • Compiletime Polymorphism
  • Method Overriding
  • Runtime Polymorphism
  • Overloading vs Overriding
  • Covariant Return Type
  • Instance Initializer Block
  • final Keyword
  • Dynamic Binding
  • instanceof Operator

Java Abstraction
  • Abstract Class
  • Interface
  • Nested Interface
  • Marker Interface
  • Abstract Vs Interface

Java Encapsulation
  • Package
  • Import
  • Access Modifiers

OOPS Misll.
  • Java Object Class
  • Object Cloning
  • Shallow Vs Deep Cloning
  • Wrapper Class
    • Byte
    • Short
    • Integer
    • Long
    • Float
    • Double
    • Boolean
    • Character
    • Number
  • strictfp keyword

Java :Array

Java :String Handling

Java :Exception Handling

Java :Collection

Java :Date & Time

Java :IO

Java :Conversion

Java :JDBC

Java :New Features

Java :Interview Questions

Java :Logging

Java :JSON Handling

Java :YAML Handling

Java : Testing

Java :Masking
Masking Tutorial

Log4j Masking
XML Masking
Java Object Masking
Java logs Masking

Web Page Masking


  • SPI
  • Aadhar Number
  • Account Number
  • Credit Card
  • CVV/CVC
  • Date Of Birth
  • Driving License
  • IP
  • ITIN
  • Rounting Number
  • SSN
  • Passport
  • Pincode/Zipcode
JSON Tutorial

JSON Overview
JSON Data Type & Syntax
JSON Java Parsers
JSON + JACKSON
  • JSON to/from Java
  • JSON to/from Java Map
  • JSON Exclude fields
  • JSON file to/from List
  • Dynamic JSON

JSON + GSON
  • GSON Installation
  • JSON Formatting
  • JSON Null Serialization
  • JSON to/from Java

JSON + YAML
  • YAML Vs JSON
  • YAML to/from JSON
  • YAML to/from JSON List

JSON SPI Masking
Log4j JSON Configuration
JSON Issues Solutions
YAML Tutorial

YAML Introduction
YAML Supporting Language and Tools
Enable YAML Editor in Eclipse
YAML Syntax
YAML Validation Online Tools
YAML & JSON
  • YAML to JSON
  • YAML to JSON List
  • JSON vs YAML

Sample filebeat.yml
  • Filebeat Logging
  • Filebeat + Logstash
  • Filebeat + Stacktrace
  • Filebeat + Elasticsearch
  • Filebeat + Kafka
  • Filebeat+ Elasticsearch + Kibana

  • YAML Issues Solutions
JDBC Tutorial

JDBC Overview

Architecture Model

History and Features Evaluations

Drivers Types and Uses

Drivers for Databases

Connect with Database

Connect with Oracle

Connect with MySQL

Connect with Access

Driver Manager Class

Connection Interface

Exception Handling

JDBC : Stored Procedure

JDBC : Function

Differences
Statement Vs PreparedStatement Vs CallableSatement

executeQuery() Vs executeUpdate() Vs execute() method

Stored Procedure vs functions

JDBC Issues & Solutions
[Solved]ClassNotFoundException: org.hsqldb.jdbcDriver

[Solved]java.sql.SQLSyntaxErrorException: unexpected token: XYZ

[Solved]CommunicationsException: Communications link failure

[Solved] SQLException: No suitable driver

[Solved]SQLServerException: Invalid object name ‘dual’

[Solved]SQLSyntaxErrorException: Unknown database ‘database_name’

[Solved]SQLException: ORA-28000: the account is locked

[Solved] MySQLNonTransientConnectionException: Could not create connection to database server.

[Solved]SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near…

[Solved]SQLException: Can’t drop database ‘database_name’; database doesn’t exist


Maven Tutorial

Maven Overview

Maven Installation
  • Install On Window
  • Install On Linux

Add 3rd Party & external jar
Application Creation
  • Java Console Project
  • Dynamic Web Application + Eclipse
Issues & Solutions
  • [Solved] Maven: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a
  • Maven Connect Timeout from/to Central “https://repo.maven.apache.org/maven2”
  • [Solved] Could not transfer artifact org.springframework:XYZ from/to central (https://repo.maven.apache.org/maven2”
  • [Solved] Maven Error On Eclipse/STS : Could Not Calculate Build Plan Org.Apache.Maven.Plugins:maven-Jar-Plugin:jar:2.4
  • [Solved] Maven Error On Eclipse/STS : Failure To Transfer Org.Apache.Maven.Plugins:maven-Surefire-Plugin:pom:2.12.4
Gradle Tutorial


Gradle Overview
Ant vs maven
Maven Vs Gradle
Gradle : Installation
  • Gradle on Window
  • Gradle on Linux/Mac

Gradle : Eclipse/STS Integration
Gradle : Repository
Gradle : Dependency
Gradle : Tasks
Gradle : Logging
Logging Tutorial

Java :Logging
  • Log4j Overview
  • Log4j2 New Features
  • Compare Other Frameworks

Log4J XML Configuration
  • Log4j Dependency
  • Log4j Severity Levels
  • Log4j Log Formatting
  • Log4j Log Appenders
  • Log4j Rolling File Appenders

Log4J JSON Configuration
  • JSON Dependency
  • JSON Configuration

Centralize Logging
  • Integrate Filebeat, Kafka, Logstash, Elasticsearch and Kibana

Logs Masking
  • Mask Logs SPI
  • Mask XML SPI
  • Mask JSON SPI
  • Mask Java Object SPI

Log4J Issues & Solutions
  • [Solved] ClassCastException: SLF4JLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
JUnit/Mockito Tutorial

  • Software Testing
  • Unit Testing
  • JUnit

JUnit 5
  • JUnit 5: Introduction
  • JUnit 5: Architecture
  • Junit 5: Env Setup
  • JUnit 5: Write Test Case

Mocking Frameworks
  • JUnit + Mockito
  • Exception Hierarchy

Code Coverage
  • JUnit : Code Coverage
  • Code Coverage Plugin

Issues & Solutions
  • Mockito Issues

Best Practices
  • JUnit : Best Practices
Advertisements
Advertisements
Advertisements

Java Tutorial


Java :Overview and Setup
  • Java Overview
  • Java Evaluation
  • Environment Setup
  • Upgrade JDK in Eclipse
  • "Hello World" Program
  • Program Execution
  • Execution Steps
  • main() Variations
  • JIT,JDK,JRE,SDK,JVM

Java Keywords
Java Data Types
  • Primitive Type
  • Non-Primitive Type

Java Variable & Literals
Java Idnetifiers
Java Statements
  • Blocks
  • Empty Statements
  • Declaration Statements
  • Expression Statements
  • Control Flow Statement
    • Decision Making
      • if
      • if-else
      • if-else if
      • switch
    • Looping
      • for loop
      • while loop
      • do-while loop
      • for-each loop
    • Branching
      • break
      • continue
      • return
Reachability of Statements
Java Operators
  • Unary Operators
  • Arithmatic Operators
  • Relational Operators
  • Conditional Operators
  • Bitwise Shift Operators
  • Logical Operators
  • Assignment Operators
  • Instanceof Operators
  • Boolean Operators
  • Ternary Operators
  • Operators Precedence

Java Comments
Java Documentation
Java OOPS Concepts
  • Naming Convention
  • Java Object
  • Java Class
  • Object Cretaion Ways
  • Type of Classes
  • Constructor
  • static keyword
  • this keyword

Java Inheritance
  • Inheritance(IS-A)
  • Aggregation(HAS-A)
  • Aggregation Vs Composition
  • super keyword
  • Constructor Chaining

Java Polymorphism
  • Method Overloading
  • Compiletime Polymorphism
  • Method Overriding
  • Runtime Polymorphism
  • Overloading vs Overriding
  • Covariant Return Type
  • Instance Initializer Block
  • final Keyword
  • Dynamic Binding
  • instanceof Operator

Java Abstraction
  • Abstract Class
  • Interface
  • Nested Interface
  • Marker Interface
  • Abstract Vs Interface

Java Encapsulation
  • Package
  • Import
  • Access Modifiers

OOPS Misll.
  • Java Object Class
  • Object Cloning
  • Shallow Vs Deep Cloning
  • Wrapper Class
    • Byte
    • Short
    • Integer
    • Long
    • Float
    • Double
    • Boolean
    • Character
    • Number
  • strictfp keyword

Java :Array

Java :String Handling

Java :Exception Handling

Java :Collection

Java :Date & Time

Java :IO

Java :Conversion

Java :JDBC

Java :New Features

Java :Interview Questions

Java :Logging

Java :JSON Handling

Java :YAML Handling

Java : Testing

Java :Masking

Tutorials

  • Data Structure and Programming Tutorial
  • Elasticsearch Tutorial
  • Filebeat Tutorial
  • Java : IO Tutorial
  • Java: Date and Time Tutorial
  • Java: Exception Handling Tutorial
  • JDBC Tutorial
  • JSON Tutorial
  • Junit 5 Tutorial
  • Kafka Tutorial
  • Logstash Tutorial
  • Maven Tutorial
  • Mockito + JUnit Tutorial
  • Spring Boot + REST Tutorial
  • TIKA Tutorial
  • YAML Tutorial

Issues Solutions

  • Camel Issues & Solutions
  • Eclipse/STS Issues & Solutions
  • Elasticsearch Issues
  • Filebeat Issues
  • Gradle Issues & Solutions
  • Hibernate Issues & Solutions
  • JAVA Issues and Solutions
  • JAXB Issues & Solutions
  • JDBC Issues and Solutions
  • JSON Issues Solutions
  • Junit/Mockito Issues & Solutions
  • Kafka and Zookeeper Issues
  • Logging/Log4j Issues & Solutions
  • Logstash Issues & Solutions
  • Maven Issues & Solutions
  • MySQL Issues & Solutions
  • OpenShift Issues & Solutions
  • Python Issues & Solutions
  • Spring Boot + REST Tutorial
  • Springboot Data/JPA Issues & Solutions
  • SQL Server Issues & Solutions
  • TIKA Issues and Solutions
  • Tomcat Issues & Solutions
  • YAML Issues

Interview Questions and Answers

  • Elasticsearch Interview Questions and Answers
  • Java: Interview Questions and Answers
  • JDBC Interview Questions And Answers
  • Spring Boot + REST Tutorial
  • [100+] Frequently Asked Java Program

Follow Our Blogs via Email

Enter your email address to follow this blog and receive notifications of our new posts by email.

Join 2,407 other subscribers

Recommendations

  • Java: Coding & Review Best Practices
  • JDBC Coding Best Practices
  • Spring Boot + REST Tutorial
Contact
 

Loading Comments...
 

You must be logged in to post a comment.

    %d bloggers like this: