Revision History
SI# | Ver# | Modified By | Modification Made | Modification Done On |
---|---|---|---|---|
1 | 0.1 | Tech Team | Initial Draft | 04/25/2019 |
1. Overview
The RBI's KYC Master Direction now allows the Aadhaar card to be accepted as an OVD as long as the Aadhaar number is concealed. We let you mask an Aadhaar card by hiding the Aadhaar Number, barcode and QR code present in a Aadhaar Card. These images can be stored for your KYC records to become compliant with the latest regulations.
Purpose of this document is to explain the approach and design of Aadhaar Id Masking solution. Aadhaar Id masking means, put a mask on the first 8 digits of 12 digit Aadhaar number, barcode and QR Code.
At high level, below given are the requirements that should be fulfilled by the proposed solution.
INPUT | OUTPUT |
---|---|
One to One: Input a JPG, PNG, PDF with 1 Aadhaar Card | We will return the file after masking Aadhaar Number, QR Code, barcode present in the Aadhaar Card. |
One to Many: Upload one PNG, JPG, PDF file with multiple Aadhaar cards | We will return the file after masking Aadhaar Number, QR Code barcode on each Aadhaar Card present in the file. |
Many to Many: Bulk upload PDF, PNG, JPG files | You can bulk upload files in an SFTP server. We will detect all Aadhaar cards present in every file and return the files to you after masking Aadhaar Number, QR Code, barcode on every Aadhaar Card. |
Note: All text or images present in the uploaded file, except for Aadhaar Card, will remain intact.
2. Solution Approach
Proposed solution works in two modes :
Case 1 :
Solution will expose an API that will accept image of Aadhaar Card as input and respond Aadhaar Card with Aadhaar number, QR Code, Barcode masked.
Input Aadhaar Card Document can be in the following formats : JPEG, PNG, PDF with ‘n’ number of pages.
Case 2 :
Supports the capability of bulk processing Aadhaar Card data.
Solution Flow will be as follows :
- Client does SFTP of Bulk Aadhaar Cards to the SFTP File Server at the specified location.
- File Processor component will read bulk files and invoke APIs and writes processed (apply mask) files back to the SFTP location.
3. How Clients consume the Service
Clients can consume Aadhaar Masking Service in one of the following means.
- doAadhaarNumberMask API - This can be used by clients for online processing.
- Bulk File Input for offline and bulk processing of Aadhaar Cards.
Following sections explain these solutions in detail.
3.1 API - doAadhaarNumberMask
There are two different ways to make the masking request.
3.1.1 POST request using JSON Payload
Http Method : POST
HTTP Headers : Content-Type : application/json
Input Payload : (As Raw JSON) which is defined below.
Request Payload Json :
{
request_id : << Random generated string which should be unique per transaction >>
client_code : << Unique code shared with the client >>
channel_code : << MOBILE / WEB_APP / DEFAULT >>
api_key : << Unique key shared with the client >>
environment : << PROD / PREPROD >>
service_code : << Service code of the API, currently “DEFAULT” >>
documents : << List containing documents which have to masked >>
[
{
“document_name” : “ “ ,
“document_data” : “Base64 document Image”
},
{
“document_name” : “ “ ,
“document_data” : “Base64 document Image”
}
.
.
.
]
3.1.2 POST Request with Multipart / Form-Data
Http Method : POST
HTTP Headers : Content-Type : application/json
Input Payload : (As form data)
Request Payload :
request_id : << Random generated string which should be unique per transaction >>
client_code : << Unique code shared with the client >>
channel_code : << MOBILE / WEB_APP / DEFAULT >>
api_key : << Unique key shared with the client >>
environment : << PROD / PREPROD >>
service_code : << Service code of the API, currently “DEFAULT” >>
document_1 : << PDF / Image file attached which is to be masked >>
document_2 : << PDF / Image file attached which is to be masked >>
document_3 : << PDF / Image file attached which is to be masked >>
.....and so on.
3.1.3 API Response
status : << SUCCESS / FAIL >>
documents : << List containing documents which were processed. >>
[
{“document_data” : “Base64 document data”,
“document_name” : “”},
{“document_data” : “Base64 document data”,
“document_name” : “”},
... and so on...
]
3.2 Bulk File Input
Solution provides the capability to process bulk inputs, where in clients can upload files in bulk to mask documents.
System expects input files to be in specific folders that is accessible over SFTP. There will be scheduled jobs that will process the files present in SFTP Location and store the results back in predefined location.
Batch can run as per scheduled frequency and will process the bulk files that are uploaded by the client in the folder corresponding to that date.
For the clients to consume the service following steps has to be executed :
- During onboarding following details will be shared.
- Host Name
- Port
- Username/Password
Client has to establish an SFTP connection to the KLs SFTP Server.
Note: Any software/SFTP client can also be used for establishing this connection.
- Client has to upload the files in the predefined location as given below.
SFTP folders
INPUT
RESPONSE
The client will create a folder with the name in the format clientCode_date
where date is in the format dd/mm/yyyy, inside the ‘INPUT’ folder. He has to put all images (jpg/png) and pdfs to be processed that day inside this folder. The job will run daily and check the folder (if exists) for that date and process all files inside it. The masked files will be put in ‘RESPONSE’ folder inside a folder named
clientCode_date
.
Eg for ‘INPUT’ folder is provided below:
INPUT / dummyCode_23082019 / file_1.jpg / file_2.png / file_3.pdf
Response files naming convention for images will be as follows :
- file_1.jpg
Response files naming convention for pdfs will be as follows:
file_3.pdf (masked pdf file)
file_3_DETAILS.csv (information about how many aadhaars were masked on which pages)
The structure for above csv file is: page_no, no_of_aadhaar_masked
Eg for ‘RESPONSE’ folder is provided below:
RESPONSE / dummyCode_23082019 / file_1.jpg / file_2.png / file_3.pdf / file_3_DETAILS.csv
NOTE: client code cannot have ‘_’
4. Input Image Specifications
Aadhaar image can as much be rotated to 40 degrees horizontal to the side(left) for the 8 digits to get masked.
Aadhaar numbers can be masked if the image is taken under low lights as well.
If Aadhaar image contain any excess width then the masking rectangle would not be aligned as it affects 1st and 9th digit.
Aadhaar masking can be done in the formats like jpg, png and pdf files.
Currently API even takes Docs like PAN as an input and responds just the same image without any masking.
Aadhaar images which are given input as upside down, mirror image (API Internal server error), vertically rotated, already masked, has no effect as it returns the same image without masking.
Aadhaar input image should either be a front image or back image, both Front and back on the same image is not supported as it returns just the same image without masking.