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 6372005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:10:25+00:00 2026-05-25T01:10:25+00:00

So I have a situation where I need to pass some parameters on url.

  • 0

So I have a situation where I need to pass some parameters on url. In order to not have id=1 on the url, I added a simple encryption method to obfuscate the values. This has worked fine within the .Net land. Now however, I need to direct from a classic asp page to this .net page that is expecting the parameters to be encrypted. I really am not too familiar with encryption or classic asp and was hoping someone would be able to direct me to a good JS lib, or simply provide a classic asp version of this function? If there’s anything wrong with the .Net code, I’d love to hear feedback on that as well.

Here’s the encryption method:

public static string Encrypt(string Input)
{
    try
    {
        key = Encoding.UTF8.GetBytes(EncryptionKey.Substring(0, 8));
        var des = new DESCryptoServiceProvider();
        Byte[] inputByteArray = Encoding.UTF8.GetBytes(Input);
        var ms = new MemoryStream();
        var cs = new CryptoStream(ms, des.CreateEncryptor(key, IV), CryptoStreamMode.Write);
        cs.Write(inputByteArray, 0, inputByteArray.Length);
        cs.FlushFinalBlock();
        return Convert.ToBase64String(ms.ToArray());
    }
    catch (Exception)
    {
        return "";
    }
}

And here’s the decryption method (I need this to decrypt the classic asp encrypted text):

public static string Decrypt(string Input)
{
    try
    {
        key = Encoding.UTF8.GetBytes(EncryptionKey.Substring(0, 8));
        var des = new DESCryptoServiceProvider();
        var inputByteArray = Convert.FromBase64String(Input);
        var ms = new MemoryStream();
        var cs = new CryptoStream(ms, des.CreateDecryptor(key, IV), CryptoStreamMode.Write);
        cs.Write(inputByteArray, 0, inputByteArray.Length);
        cs.FlushFinalBlock();

        Encoding encoding = Encoding.UTF8;
        return encoding.GetString(ms.ToArray());

    }
    catch (Exception)
    {
        return "";
    }
}

Thanks for any help!

  • 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. Editorial Team
    Editorial Team
    2026-05-25T01:10:26+00:00Added an answer on May 25, 2026 at 1:10 am

    Don’t mean to answer my own question, but I couldn’t get the code added as a comment. Anyway, I ended up implementing RC4 on the client anyway. For anyone who may be interested (wth are you doing working in classic asp?? 🙂 ) Here’s the relevant code – hope it helps! As always, if anyone spots a problem with this snippet, please let me know!

    Thanks,

    Matt

    Dim sbox(255)
    Dim key(255)
    
    Sub RC4Initialize(strPwd)
      dim tempSwap
      dim a
      dim b
    
      intLength = len(strPwd)
      For a = 0 To 255
         key(a) = asc(mid(strpwd, (a mod intLength)+1, 1))
         sbox(a) = a
      next
    
      b = 0
      For a = 0 To 255
         b = (b + sbox(a) + key(a)) Mod 256
         tempSwap = sbox(a)
         sbox(a) = sbox(b)
         sbox(b) = tempSwap
      Next
    
    End Sub
    
    Function EnDeCrypt(plaintxt)
      dim temp
      dim a
      dim i
      dim j
      dim k
      dim cipherby
      dim cipher
    
      i = 0
      j = 0
    
      RC4Initialize "somesortofpassword"
    
      For a = 1 To Len(plaintxt)
         i = (i + 1) Mod 256
         j = (j + sbox(i)) Mod 256
         temp = sbox(i)
         sbox(i) = sbox(j)
         sbox(j) = temp
    
         k = sbox((sbox(i) + sbox(j)) Mod 256)
    
         cipherby = Asc(Mid(plaintxt, a, 1)) Xor k
         dim h
         h = hex(cipherby)
         if Len(h) = 1 then
            h = "0" & h
          end if
         cipher = cipher & h
      Next
    
      EnDeCrypt = cipher
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have a situation where I need to pass in three values into
Hey i have a situation in which i need to pass some variable value
I have situation where I need to change the order of the columns/adding new
I have a situation where I need to notify some users when something in
I have a situation as below in which I need to pass a C-style
I have a situation where I need to be able to load assemblies in
I have a situation where I need to work with a datagrid and adding
I have a situation where i need to debug a Windows CE application in
I have a situation where I need to add an arbitrary unique id to
I have a situation where I need to do something like select 2, id

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.