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

  • Home
  • SEARCH
  • 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 6088239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:57:45+00:00 2026-05-23T11:57:45+00:00

I asked some questions before. Thanks for the help. My need is to encrypt

  • 0

I asked some questions before. Thanks for the help.

My need is to encrypt a URL. So I start off with a URL, I encrypt it, make a link on my page that uses the URL. When the user clicks the link it goes to a controller (MVC), I decrypt the URL, get my data and display it. It works very well so far.

What I am thinking to do is to make it so that the URL encryption is based on the users ID plus a chosen key value. Everything is on the server so the keys would just be in two scripts.

So how could I set my key. Say for example that I wanted the key to be equal to the user_name plus “hjshdasd” where the “hj..” is always same and secret to me. Currently the key is a byte array. How can I just make it the above string.

Am I correct in saying that I could set the IV to anything as everything is internal and known just to my own scripts. Any suggestions on how I could set this? Bear in mind that I want the encryption to always be the same so I guess my IV would always be the same as well as I would have the same key for a certain user every time.

Thanks,

private static byte[] key = { 123, 217, 19, 11, 24, 26, 85, 45, 114, 184, 27, 162, 37, 112, 222, 209, 241, 24, 175, 144, 173, 53, 196, 29, 24, 26, 17, 218, 131, 236, 53, 209 };
    private static byte[] vector = { 146, 64, 191, 111, 23, 3, 113, 119, 231, 121, 221, 112, 79, 32, 114, 156 };
    private ICryptoTransform encryptor, decryptor;
    private UTF8Encoding encoder;

    public SimplerAES()
    {
        RijndaelManaged rm = new RijndaelManaged();
        encryptor = rm.CreateEncryptor(key, vector);
        decryptor = rm.CreateDecryptor(key, vector);
        encoder = new UTF8Encoding();
    }
  • 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-23T11:57:45+00:00Added an answer on May 23, 2026 at 11:57 am

    The Rfc2898DeriveBytes class is probably what you are looking for. Give it the user id, and your salt in the constructor. Your salt should not be based on text – it should be a completely random byte array.

    The purpose of this class is, “Given a string, such as a password, give me a byte[] suitable for use as a key.” The MSDN documentation has good examples on how to use it.

    That being said; I’d be careful about putting sensitive information in a query string. If it is something sensitive, such as an SSN – don’t put it in the query string; even if you encrypt it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is quite relevant to something asked before but I need some practical
I know similar questions have been asked before, so don't get snarky and link
(I know some people already asked questions about js profile, but that's not what
Reference to the Question I asked before, the socket closing need some times to
Ok, I see that people have asked this question before, but I'm seeing some
I've been into this problem for a while already, and have asked some questions
I asked some similar questions [1, 2] yesterday and got great answers, but I
I believe this questions has been asked in some or the other way but
There have been some similar questions asked regarding Grid views, but none have been
I know that the question has been asked before , but it's been two

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.