In a bunch of APIs, there are several possible query parameters. Some of these may be PHI. So even if we are using HTTPS, they could go to a logfile or somewhere else and hence violate PHI.

Was thinking of an approach where the parameters would be encrypted in the client and then decrypted by the server. On login, the server would give the client an encryption key and then the client has to use this for query param values. The server than decrypts the query params using the same encryption key.

I am reluctant to solve a security risk in a way that is not commonly known.

So, I am wondering is the approach I am suggesting used at all? The only other approach would be to use POST and instead of query params, the params come up in the BODY?

  • 2
    In general, you should never send sensitive information as a GET parameter for this very reason. – MechMK1 Jul 29 '19 at 16:53

Overall GET is something you would avoid to send query parameters, POST is the way to go.

If you would like to encrypt the messages inside the POST, for they can also easily be logged the same way GET requests are, I would suggest using something like JWE (Json Web Encryption). This is basically a JSON payload encrypted inside a JWT (Json Web Token) https://tools.ietf.org/html/rfc7516

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.