Note that there are some explanatory texts on larger screens.

plurals
  1. POConvert snippet from c# to vbscript
    primarykey
    data
    text
    <p>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.</p> <p>Here's the encryption method:</p> <pre><code>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 ""; } } </code></pre> <p>And here's the decryption method (I need this to decrypt the classic asp encrypted text):</p> <pre><code>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 ""; } } </code></pre> <p>Thanks for any help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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