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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:14:28+00:00 2026-06-02T02:14:28+00:00

We have a class that holds the user’s logon profiles, it’s a simple class

  • 0

We have a class that holds the user’s logon profiles, it’s a simple class that we just serialize to disk. We could certainly encrypt, compress, etc. etc. the serialization process, however, I want to keep it simple for other reasons.

One item that is serialized is the Password (string) property. I don’t mind that it’s being serialized but I want the value that is serialized to be 3DES encrypted so if someone were to open the file in some reader it wouldn’t compromise the password. I know I can simply SET the password value as the encrypted value and GET the encrypted value but I want to automate it a little bit so that when the GET’er is called it handles the decryption, the SET’er handles the encryption so it’s seamless.

What do you suggest is the best way to go about this? What I’m thinking is I need to mark the “Password” property to be ignored by the serializer and it’s just a path to another property that holds the encrypted value and therefore returns it decrypted. Is this the best/only way to handle this? Just want to see if there is a simpler way before I go coding this up via the only way I can see doing this to keep the encryption/decryption within the serialized class logic.

Thanks.

  • 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-02T02:14:29+00:00Added an answer on June 2, 2026 at 2:14 am

    You can mark the password property to be ignored by serialization and use kind of an wrapper property to be serialized:

    public class LogonInfo
    {
        [XmlIgnore]
        public string Password { get; set; }
    
        public string EncPassword {
        {
            get
            {
                return Encrypt(Password);
            }
            set
            {
                Password = Decrypt(value);
            }
        }
    
        // TODO: add Encrypt and Decrypt methods
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that holds valid licenses for a user and every 15
I have a class that holds another objects inside it (List, Set and objects
I have a class Team that holds a generic list: [DataContract(Name = TeamDTO, IsReference
I have a private class variable that holds a collection of order items: Private
I have a class includes.vb that holds some variables (sharing them with other pages)
I have an abstract base class that holds a Dictionary. I'd like inherited classes
I have a class in C++ that I can't modify. However, that class holds
I have this small class called City that simply holds some information about a
I have a parent class that holds all of the fields that are common
I have a Property in my App.xaml.cs called User that holds the User details.

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.