Encrypt Url Parameter In asp.net MvcAre HTTPS URLs encrypted?What are MVP and MVC and what is the difference?Encode URL in JavaScript?Path.Combine for URLs?Get current URL with jQuery?What is the difference between MVC and MVVM?How do I modify the URL without reloading the page?Set a default parameter value for a JavaScript functionGet the current URL with JavaScript?Open a URL in a new tab (and not a new window) using JavaScriptReact-router urls don't work when refreshing or writing manually

Where is this photo of a group of hikers taken? Is it really in the Ural?

Inverse Colombian Function

Ultraproduct of Dividing Lines

What does a black-and-white Puerto Rican flag signify?

Chemistry Riddle

Import data from a current web session?

High income and difficulty during interviews

Can you find Airpod Case using Find my iPhone?

What is an expert set in the fonts field?

Host telling me to cancel my booking in exchange for a discount?

Is the apartment I want to rent a scam?

Are rockets faster than airplanes?

Giving blur shadow to plot

Can't understand how static works exactly

How am I supposed to put out fires?

Company requiring me to let them review research from before I was hired

What is the best word describing the nature of expiring in a short amount of time, connoting "losing public attention"?

What's the 1 inch size square knob sticking out of wall?

Considerations when providing money to one child now, and the other later?

What is a plausible power source to indefinitely sustain a space station?

Can we have too many dialogue tags and follow up actions?

How can Kazakhstan perform MITM attacks on all HTTPS traffic?

Why is the UH-60 tail rotor canted?

If I have the Armor of Shadows Eldritch Invocation do I know the Mage Armor spell?



Encrypt Url Parameter In asp.net Mvc


Are HTTPS URLs encrypted?What are MVP and MVC and what is the difference?Encode URL in JavaScript?Path.Combine for URLs?Get current URL with jQuery?What is the difference between MVC and MVVM?How do I modify the URL without reloading the page?Set a default parameter value for a JavaScript functionGet the current URL with JavaScript?Open a URL in a new tab (and not a new window) using JavaScriptReact-router urls don't work when refreshing or writing manually






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















@using(Html.BeginForm("Action", "Controller", FormMethod.Get)



 
@Html.TextBoxFor(model=>model.Id)
<input type="submit" value="Search" />



1-When we click On Submit Button this will Create Url Like this



 http://localhost:53734/Controller/Action?id=10 
//10 is input From Textbox


I want to encrypt Id parameter like
http://localhost:53734/Controller/Action?id=encrypted Value Of 10










share|improve this question



















  • 2





    Use HTTPS instead. If you encrypt anything in Javascript it will be obvious to whoever has access to the page source. That includes the hackers that may hack any intermediate proxy, router.

    – Panagiotis Kanavos
    Mar 26 at 14:31












  • @MohammadAlghanem this is primarily a Javascript question.

    – Panagiotis Kanavos
    Mar 26 at 14:33











  • What are you trying to protect against? Prevent someone between client and server from stealing the parameters? Or prevent the server-side code from reading the parameter? Encryption could protect only against the second case

    – Panagiotis Kanavos
    Mar 26 at 14:46











  • Only want to protect Url server Side user Can't see the actual value of id Paramete

    – Pradeep Vaishya
    Mar 26 at 14:58

















-1















@using(Html.BeginForm("Action", "Controller", FormMethod.Get)



 
@Html.TextBoxFor(model=>model.Id)
<input type="submit" value="Search" />



1-When we click On Submit Button this will Create Url Like this



 http://localhost:53734/Controller/Action?id=10 
//10 is input From Textbox


I want to encrypt Id parameter like
http://localhost:53734/Controller/Action?id=encrypted Value Of 10










share|improve this question



















  • 2





    Use HTTPS instead. If you encrypt anything in Javascript it will be obvious to whoever has access to the page source. That includes the hackers that may hack any intermediate proxy, router.

    – Panagiotis Kanavos
    Mar 26 at 14:31












  • @MohammadAlghanem this is primarily a Javascript question.

    – Panagiotis Kanavos
    Mar 26 at 14:33











  • What are you trying to protect against? Prevent someone between client and server from stealing the parameters? Or prevent the server-side code from reading the parameter? Encryption could protect only against the second case

    – Panagiotis Kanavos
    Mar 26 at 14:46











  • Only want to protect Url server Side user Can't see the actual value of id Paramete

    – Pradeep Vaishya
    Mar 26 at 14:58













-1












-1








-1








@using(Html.BeginForm("Action", "Controller", FormMethod.Get)



 
@Html.TextBoxFor(model=>model.Id)
<input type="submit" value="Search" />



1-When we click On Submit Button this will Create Url Like this



 http://localhost:53734/Controller/Action?id=10 
//10 is input From Textbox


I want to encrypt Id parameter like
http://localhost:53734/Controller/Action?id=encrypted Value Of 10










share|improve this question
















@using(Html.BeginForm("Action", "Controller", FormMethod.Get)



 
@Html.TextBoxFor(model=>model.Id)
<input type="submit" value="Search" />



1-When we click On Submit Button this will Create Url Like this



 http://localhost:53734/Controller/Action?id=10 
//10 is input From Textbox


I want to encrypt Id parameter like
http://localhost:53734/Controller/Action?id=encrypted Value Of 10







javascript c# asp.net model-view-controller






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 14:34









Panagiotis Kanavos

62k5 gold badges87 silver badges120 bronze badges




62k5 gold badges87 silver badges120 bronze badges










asked Mar 26 at 14:28









Pradeep VaishyaPradeep Vaishya

12 bronze badges




12 bronze badges







  • 2





    Use HTTPS instead. If you encrypt anything in Javascript it will be obvious to whoever has access to the page source. That includes the hackers that may hack any intermediate proxy, router.

    – Panagiotis Kanavos
    Mar 26 at 14:31












  • @MohammadAlghanem this is primarily a Javascript question.

    – Panagiotis Kanavos
    Mar 26 at 14:33











  • What are you trying to protect against? Prevent someone between client and server from stealing the parameters? Or prevent the server-side code from reading the parameter? Encryption could protect only against the second case

    – Panagiotis Kanavos
    Mar 26 at 14:46











  • Only want to protect Url server Side user Can't see the actual value of id Paramete

    – Pradeep Vaishya
    Mar 26 at 14:58












  • 2





    Use HTTPS instead. If you encrypt anything in Javascript it will be obvious to whoever has access to the page source. That includes the hackers that may hack any intermediate proxy, router.

    – Panagiotis Kanavos
    Mar 26 at 14:31












  • @MohammadAlghanem this is primarily a Javascript question.

    – Panagiotis Kanavos
    Mar 26 at 14:33











  • What are you trying to protect against? Prevent someone between client and server from stealing the parameters? Or prevent the server-side code from reading the parameter? Encryption could protect only against the second case

    – Panagiotis Kanavos
    Mar 26 at 14:46











  • Only want to protect Url server Side user Can't see the actual value of id Paramete

    – Pradeep Vaishya
    Mar 26 at 14:58







2




2





Use HTTPS instead. If you encrypt anything in Javascript it will be obvious to whoever has access to the page source. That includes the hackers that may hack any intermediate proxy, router.

– Panagiotis Kanavos
Mar 26 at 14:31






Use HTTPS instead. If you encrypt anything in Javascript it will be obvious to whoever has access to the page source. That includes the hackers that may hack any intermediate proxy, router.

– Panagiotis Kanavos
Mar 26 at 14:31














@MohammadAlghanem this is primarily a Javascript question.

– Panagiotis Kanavos
Mar 26 at 14:33





@MohammadAlghanem this is primarily a Javascript question.

– Panagiotis Kanavos
Mar 26 at 14:33













What are you trying to protect against? Prevent someone between client and server from stealing the parameters? Or prevent the server-side code from reading the parameter? Encryption could protect only against the second case

– Panagiotis Kanavos
Mar 26 at 14:46





What are you trying to protect against? Prevent someone between client and server from stealing the parameters? Or prevent the server-side code from reading the parameter? Encryption could protect only against the second case

– Panagiotis Kanavos
Mar 26 at 14:46













Only want to protect Url server Side user Can't see the actual value of id Paramete

– Pradeep Vaishya
Mar 26 at 14:58





Only want to protect Url server Side user Can't see the actual value of id Paramete

– Pradeep Vaishya
Mar 26 at 14:58












1 Answer
1






active

oldest

votes


















0














As I understand you want to "hide" and "protect" the request. The best solution is to:



  • Use HTTPS so the transport will provide encryption

  • All parameters in GET and POST are encrypted (more Are HTTPS URLs encrypted?).

If it is not possible, use RSACryptProvider to encrypt parameter. The universal encryption code is in MSDN: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rsacryptoserviceprovider?view=netframework-4.7.2






share|improve this answer




















  • 1





    URLs are also encrypted. The entire payload is encrypted, not just parts of it.

    – Panagiotis Kanavos
    Mar 26 at 14:36











  • As for using AES (ie RSA) the Javascript code would have to encrypt the parameter using a common password. Both the encryption code and the password would be exposed to any MITM attack.

    – Panagiotis Kanavos
    Mar 26 at 14:39











  • @PanagiotisKanavos you are right, I will update an answer

    – Piotr Stapp
    Mar 26 at 14:41











  • @PanagiotisKanavos but his code is not JavaScript it is classic ASP.NET MVC

    – Piotr Stapp
    Mar 26 at 14:42











  • Who's going to encrypt the form's fields?

    – Panagiotis Kanavos
    Mar 26 at 14:43










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55359609%2fencrypt-url-parameter-in-asp-net-mvc%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














As I understand you want to "hide" and "protect" the request. The best solution is to:



  • Use HTTPS so the transport will provide encryption

  • All parameters in GET and POST are encrypted (more Are HTTPS URLs encrypted?).

If it is not possible, use RSACryptProvider to encrypt parameter. The universal encryption code is in MSDN: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rsacryptoserviceprovider?view=netframework-4.7.2






share|improve this answer




















  • 1





    URLs are also encrypted. The entire payload is encrypted, not just parts of it.

    – Panagiotis Kanavos
    Mar 26 at 14:36











  • As for using AES (ie RSA) the Javascript code would have to encrypt the parameter using a common password. Both the encryption code and the password would be exposed to any MITM attack.

    – Panagiotis Kanavos
    Mar 26 at 14:39











  • @PanagiotisKanavos you are right, I will update an answer

    – Piotr Stapp
    Mar 26 at 14:41











  • @PanagiotisKanavos but his code is not JavaScript it is classic ASP.NET MVC

    – Piotr Stapp
    Mar 26 at 14:42











  • Who's going to encrypt the form's fields?

    – Panagiotis Kanavos
    Mar 26 at 14:43















0














As I understand you want to "hide" and "protect" the request. The best solution is to:



  • Use HTTPS so the transport will provide encryption

  • All parameters in GET and POST are encrypted (more Are HTTPS URLs encrypted?).

If it is not possible, use RSACryptProvider to encrypt parameter. The universal encryption code is in MSDN: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rsacryptoserviceprovider?view=netframework-4.7.2






share|improve this answer




















  • 1





    URLs are also encrypted. The entire payload is encrypted, not just parts of it.

    – Panagiotis Kanavos
    Mar 26 at 14:36











  • As for using AES (ie RSA) the Javascript code would have to encrypt the parameter using a common password. Both the encryption code and the password would be exposed to any MITM attack.

    – Panagiotis Kanavos
    Mar 26 at 14:39











  • @PanagiotisKanavos you are right, I will update an answer

    – Piotr Stapp
    Mar 26 at 14:41











  • @PanagiotisKanavos but his code is not JavaScript it is classic ASP.NET MVC

    – Piotr Stapp
    Mar 26 at 14:42











  • Who's going to encrypt the form's fields?

    – Panagiotis Kanavos
    Mar 26 at 14:43













0












0








0







As I understand you want to "hide" and "protect" the request. The best solution is to:



  • Use HTTPS so the transport will provide encryption

  • All parameters in GET and POST are encrypted (more Are HTTPS URLs encrypted?).

If it is not possible, use RSACryptProvider to encrypt parameter. The universal encryption code is in MSDN: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rsacryptoserviceprovider?view=netframework-4.7.2






share|improve this answer















As I understand you want to "hide" and "protect" the request. The best solution is to:



  • Use HTTPS so the transport will provide encryption

  • All parameters in GET and POST are encrypted (more Are HTTPS URLs encrypted?).

If it is not possible, use RSACryptProvider to encrypt parameter. The universal encryption code is in MSDN: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rsacryptoserviceprovider?view=netframework-4.7.2







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 26 at 14:43

























answered Mar 26 at 14:35









Piotr StappPiotr Stapp

15.1k5 gold badges51 silver badges92 bronze badges




15.1k5 gold badges51 silver badges92 bronze badges







  • 1





    URLs are also encrypted. The entire payload is encrypted, not just parts of it.

    – Panagiotis Kanavos
    Mar 26 at 14:36











  • As for using AES (ie RSA) the Javascript code would have to encrypt the parameter using a common password. Both the encryption code and the password would be exposed to any MITM attack.

    – Panagiotis Kanavos
    Mar 26 at 14:39











  • @PanagiotisKanavos you are right, I will update an answer

    – Piotr Stapp
    Mar 26 at 14:41











  • @PanagiotisKanavos but his code is not JavaScript it is classic ASP.NET MVC

    – Piotr Stapp
    Mar 26 at 14:42











  • Who's going to encrypt the form's fields?

    – Panagiotis Kanavos
    Mar 26 at 14:43












  • 1





    URLs are also encrypted. The entire payload is encrypted, not just parts of it.

    – Panagiotis Kanavos
    Mar 26 at 14:36











  • As for using AES (ie RSA) the Javascript code would have to encrypt the parameter using a common password. Both the encryption code and the password would be exposed to any MITM attack.

    – Panagiotis Kanavos
    Mar 26 at 14:39











  • @PanagiotisKanavos you are right, I will update an answer

    – Piotr Stapp
    Mar 26 at 14:41











  • @PanagiotisKanavos but his code is not JavaScript it is classic ASP.NET MVC

    – Piotr Stapp
    Mar 26 at 14:42











  • Who's going to encrypt the form's fields?

    – Panagiotis Kanavos
    Mar 26 at 14:43







1




1





URLs are also encrypted. The entire payload is encrypted, not just parts of it.

– Panagiotis Kanavos
Mar 26 at 14:36





URLs are also encrypted. The entire payload is encrypted, not just parts of it.

– Panagiotis Kanavos
Mar 26 at 14:36













As for using AES (ie RSA) the Javascript code would have to encrypt the parameter using a common password. Both the encryption code and the password would be exposed to any MITM attack.

– Panagiotis Kanavos
Mar 26 at 14:39





As for using AES (ie RSA) the Javascript code would have to encrypt the parameter using a common password. Both the encryption code and the password would be exposed to any MITM attack.

– Panagiotis Kanavos
Mar 26 at 14:39













@PanagiotisKanavos you are right, I will update an answer

– Piotr Stapp
Mar 26 at 14:41





@PanagiotisKanavos you are right, I will update an answer

– Piotr Stapp
Mar 26 at 14:41













@PanagiotisKanavos but his code is not JavaScript it is classic ASP.NET MVC

– Piotr Stapp
Mar 26 at 14:42





@PanagiotisKanavos but his code is not JavaScript it is classic ASP.NET MVC

– Piotr Stapp
Mar 26 at 14:42













Who's going to encrypt the form's fields?

– Panagiotis Kanavos
Mar 26 at 14:43





Who's going to encrypt the form's fields?

– Panagiotis Kanavos
Mar 26 at 14:43








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55359609%2fencrypt-url-parameter-in-asp-net-mvc%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript