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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:28:30+00:00 2026-05-28T07:28:30+00:00

I am working over one my student project over .Net4 and MVC3. Project is

  • 0

I am working over one my student project over .Net4 and MVC3.
Project is almost at completion except some security features such as Encoding/Decoding information for saving in config file such as Connection String etc.

I want to avoid a very complex solution and so I am looking for some easy to use Encryption technique in .NET ideally something where I can just provide a KEY and String and it gives me back the encoded text and vice versa (similar to the Base64 example given below).

I went through MSDN’s System.Security.Cryptography Namespace documentation online but it has a lot of options for a newbie like me I guess.

Kindly provide me with suggestions and path to follow to achieve it.
Thank you.


While searching I found a simple solution of Base64 which I implemented like this:

    static public string EncodeTo64(string toEncode)
    {
        byte[] toEncodeAsBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(toEncode);
        string encodedValue = System.Convert.ToBase64String(toEncodeAsBytes);
        return encodedValue;
    }

    static public string DecodeFrom64(string toDecode)
    {
        var toDecodeAsString = System.Convert.FromBase64String(toDecode);
        string decodedValue = System.Text.ASCIIEncoding.ASCII.GetString(toDecodeAsString);
        return decodedValue;
    }

Works fine but the problem is as far as I’ve understood this is not something very reliable as a static encoding technique (one without a custom KEY) can be easily decoded and so many online base 64 decoders are available on net. I also tried to work with AES as expalined here but failed to succeed.

  • 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-28T07:28:31+00:00Added an answer on May 28, 2026 at 7:28 am

    For maximum simplicity just have a look at Windows’ Data Protection API (DAPI). This will provide encryption without requiring you to handle the keys.

    You can easily use this with the ProtectedData class provided in .NET.

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

Sidebar

Related Questions

I need to get the free Google charts working over SSL without any security
I'm working on converting some NSURLConnection code over to AFNetworking and I'm seeing a
I've been working on a long-term project for over a year now and love
I'm working on a project whereby the University has full control over the source
I switched a project I'm working on over to maven and suddenly auto boxing
I recently took over a project that a colleague was working on and I
I have a chart in excel that represents some value over a one day
Tonight I've been taking a look at some code I've been working on over
Some context: one of the systems I'm working on is a .net 2.0 web
im working on a student project where I need to know which button in

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.