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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:15:47+00:00 2026-06-05T06:15:47+00:00

I need to store a password as an encrypted string in an XML file,

  • 0

I need to store a password as an encrypted string in an XML file, and be able to pull it back out again. A quick glance through the System.Security.Cryptography Namespace reveals many options, some of which are hashing and some encryption.

This is the first time I have done any kind of string encryption (where the value is pulled back out again), and I was expecting something like this:

string plainTextPassword = "mypassword";
string myKey = "some key that people are unlikely to guess";
string encryptedPassword = SomeObject.Encrypt(myKey, plainTextPassword);
// ... write encryptedPassword to xml file ...

and

// ... read encryptedPassword from xml file ...
string decryptedPassword = SomeObject.Decrypt(myKey, encryptedPassword);

But when I look in the namespace there are services that provide hashing in there also, rather than purely encryption. I also notice that a lot of other questions are more around hashing (or at least one way encryption) and are not particularly concerned with retrieving the strings afterwards.

I definitely want more than just hashing the password. Where should I start?

  • 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-06-05T06:15:49+00:00Added an answer on June 5, 2026 at 6:15 am

    This CodeProject article will answer all your questions as well as provide code snippets to help solve your problem: http://www.codeproject.com/Articles/10154/NET-Encryption-Simplified

    The code samples are VB.NET (just noticed) but easy enough to convert to C#. Pay attention to how hashes are used with encryption techniques, they are not encryption.

    Here’s a code sample using Rijndael: http://kiranpatils.wordpress.com/2008/03/13/encryptiondecryption-helper-class-using-rijandelmanaged/ The way it
    s implemented sucks for “strength” of encryption but will get something going quickly (hopefully.)

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

Sidebar

Related Questions

After a user signs in and his password is verified, I need to store
I am using Postgresql,hibernate and Java and I need to store a password. Can
I'm trying to store a password in a file that I'd like to retrieve
I need to store my users' name/password somewhere (preferably the Registry) so my .Net
I have id values for products that I need store. Right now they are
I need to store various info about some movies, books, games, and maybe other
I need to store IP address in the most compact way possible, searching is
I need to store up to tens or even hundreds of millions of pieces
I need to store a series of configuration values in a database. A couple
I need to store a lot of data coming in from a server into

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.