Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:58:31+00:00 2026-05-10T18:58:31+00:00

I need to encrypt and decrypt a querystring in ASP.NET. The querystring might look

  • 0

I need to encrypt and decrypt a querystring in ASP.NET.

The querystring might look something like this:

http://www.mysite.com/report.aspx?id=12345&year=2008

How do I go about encrypting the entire querystring so that it looks something like the following?

http://www.mysite.com/report.aspx?crypt=asldjfaf32as98df8a

And then, of course, how to I decrypt it? What’s the best encryption to use for something like this? TripleDES?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:58:31+00:00Added an answer on May 10, 2026 at 6:58 pm

    Here is a way to do it in VB From: http://www.devcity.net/Articles/47/1/encrypt_querystring.aspx

    Wrapper for the encryption code: Pass your querystring parameters into this, and change the key!!!

    Private _key as string = '!#$a54?3' Public Function encryptQueryString(ByVal strQueryString As String) As String     Dim oES As New ExtractAndSerialize.Encryption64()     Return oES.Encrypt(strQueryString, _key) End Function  Public Function decryptQueryString(ByVal strQueryString As String) As String     Dim oES As New ExtractAndSerialize.Encryption64()     Return oES.Decrypt(strQueryString, _key) End Function 

    Encryption Code:

    Imports System Imports System.IO Imports System.Xml Imports System.Text Imports System.Security.Cryptography  Public Class Encryption64     Private key() As Byte = {}     Private IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}      Public Function Decrypt(ByVal stringToDecrypt As String, _         ByVal sEncryptionKey As String) As String         Dim inputByteArray(stringToDecrypt.Length) As Byte          Try             key = System.Text.Encoding.UTF8.GetBytes(Left(sEncryptionKey, 8))             Dim des As New DESCryptoServiceProvider()             inputByteArray = Convert.FromBase64String(stringToDecrypt)             Dim ms As New MemoryStream()             Dim cs As New CryptoStream(ms, des.CreateDecryptor(key, IV), _                 CryptoStreamMode.Write)             cs.Write(inputByteArray, 0, inputByteArray.Length)             cs.FlushFinalBlock()             Dim encoding As System.Text.Encoding = System.Text.Encoding.UTF8             Return encoding.GetString(ms.ToArray())         Catch e As Exception             Return e.Message         End Try     End Function      Public Function Encrypt(ByVal stringToEncrypt As String, _         ByVal SEncryptionKey As String) As String         Try             key = System.Text.Encoding.UTF8.GetBytes(Left(SEncryptionKey, 8))             Dim des As New DESCryptoServiceProvider()             Dim inputByteArray() As Byte = Encoding.UTF8.GetBytes( _                 stringToEncrypt)             Dim ms As New MemoryStream()             Dim cs As New CryptoStream(ms, des.CreateEncryptor(key, IV), _                 CryptoStreamMode.Write)             cs.Write(inputByteArray, 0, inputByteArray.Length)             cs.FlushFinalBlock()             Return Convert.ToBase64String(ms.ToArray())         Catch e As Exception             Return e.Message         End Try     End Function  End Class 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 197k
  • Answers 197k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are not worried about performance, you could use… May 12, 2026 at 7:20 pm
  • Editorial Team
    Editorial Team added an answer It is a marketing term IMHO :) Basically Microsoft is… May 12, 2026 at 7:20 pm
  • Editorial Team
    Editorial Team added an answer I doubt there's a better way than listing out the… May 12, 2026 at 7:20 pm

Related Questions

I've been tasked with encrypting several years worth of sensitive data (don't ask) stored
I have no idea what I'm doing wrong. I just need to be able
I need two methods one to encrypt and one to decrypt an xml file
I need to transfer data from a PHP script on my local server to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.