Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is a way to do it in VB From: <a href="http://www.devcity.net/Articles/47/1/encrypt_querystring.aspx" rel="nofollow noreferrer">http://www.devcity.net/Articles/47/1/encrypt_querystring.aspx</a></p> <p><strong>Wrapper for the encryption code:</strong> Pass your querystring parameters into this, and change the key!!!</p> <pre><code>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 </code></pre> <p><strong>Encryption Code:</strong></p> <pre><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 = {&amp;H12, &amp;H34, &amp;H56, &amp;H78, &amp;H90, &amp;HAB, &amp;HCD, &amp;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 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload