Is there a library that masks sensitive fields(encrypts with random characters) in Rest API response. The masked data should be sent back to the UI. And if UI sends the masked data back in consecutive requests, it should be again unmasked and send it to server(so that server can interpret and work correctly).
Note: I don't want to exclude the fields in response. I want to perform operation on the masked data based on user interaction on UI.
Say, If there's a credit card number in API response, this should be shown as xxxxxxyyyyyy in UI... And when UI want to send it back in a post call, it should be unmasked and sent back to server