How can we decrypt query parameter before call controller action method ?
I need a solution with a easiest way that use common.
Loading
How can we decrypt query parameter before call controller action method ?
I need a solution with a easiest way that use common.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajesh GamiPosted Aug 1, 2022, 11:27 AM
Hi,
You can use middleware for a decrypt your parameter before the controller call and it's just one function call so in my point of view this is the best and easiest way,
But make sure to use the same algorithm for decrypting as you used for encrypting.
So create one middleware helper and make a function for a decrypt and after that call this middleware from startup.cs file (under configure).
You can refer to my blog.
https://rajeshgami93.blogspot.com/2022/07/encrypt-encrypt-payloadparameter-using.html
Or you can refer to this blog also:
https://www.c-sharpcorner.com/article/asp-net-core-middleware/
Peter CruisePosted Aug 1, 2022, 11:58 AM
Rajanikant HawaldarPosted Aug 1, 2022, 11:50 AM