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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현