Patent ID: 11966498
Assignee: TATA CONSULTANCY SERVICES LIMITED
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 0:
1. A processor-implemented method for masking data at-source comprising:
receiving, via one or more hardware processors, a response output comprising a sensitive data, based on a user request, from a table of a production database;
identifying, via the one or more hardware processors, a valid key column with at least one unique identifier from the table of the production database, based on the response output, for masking of sensitive data in the response output, wherein the valid key column includes a pseudo column, a primary key column or a unique key column which is not part of a masking request;
in response to a restriction on creating a unique auto-increment column in the table of the production database using a production database function, creating, via the one or more hardware processors, the unique auto-increment column using a sensitive key present in the table of the production database, wherein the sensitive key is a part of the masking request, wherein data type of the created unique auto-increment column is an integer and the unique auto-increment column contains sequential values starting from one to row count of the table in the production database;
in absence of the valid key column and failure of creation of the unique auto-increment column using the sensitive key in the table of the production database, creating the unique auto-increment column containing the unique identifier using an external code, wherein the external code generates the unique identifier for each row in the table of the production database;
creating, via the one or more hardware processors, at least one temporary table comprising three or more columns by executing a data definition language (DDL) operation, wherein at least one column of the temporary table comprising the sensitive data of the production database;
masking, via the one or more hardware processors, the sensitive data of the at least one column of the temporary table using predefined masking rules;
inserting, via the one or more hardware processors, the at least one masked column of the temporary table in the production database; and
updating, via the one or more hardware processors, the production database with masked sensitive data of the at least one column of the temporary column, wherein the temporary table comprising the identified valid key column with at least one unique identifier or the unique auto-increment column, original data of a sensitive key column and masked data of the sensitive key column for at-source data masking, wherein the sensitive key column is the primary key column or the unique key column, wherein the at-source data masking is used, when a source database and a target database are same.