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

The Archive Base Latest Questions

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

I am trying to encrypt data that a serializable (xml) class contains. Here is

  • 0

I am trying to encrypt data that a serializable (xml) class contains. Here is a simple example:

[XmlRootAttribute("FooClass")] 
public class FooClass
{
    private string _personalData;

    public PersonalData
    {
        set { _personalData = value;}
        get { return _personalData; }
    }
}

Assume there are ready to be used tho methods: Encrypt & Decrypt. Is there a way to use them somehow during the serialization in order to encrypt PersonalData in the serialized output?

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

    Yes. Mark PersonalData as nonserialized, then add a new property to return and accept the serialized data (note that the XmlAttribute is optional):

    [XmlRootAttribute("FooClass")] 
    public class FooClass
    {
        private string _personalData;
    
        [NonSerialized()]
        public string PersonalData
        {
            set { _personalData = value;}
            get { return _personalData; }
        }
    
        [XmlAttribute("PersonalData")]
        public string PersonalDataEncrypted
        {
            set { _personalData = DecryptData(value);}
            get { return EncryptData(_personalData); }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to encrypt some data with the following code: public static byte[]
I'm trying to use a JavaScript library to encrypt data and send that to
Talking about javax.crypto.Cipher I was trying to encrypt data using Cipher.getInstance(RSA/None/NoPadding, BC) but I
I'm trying to measure how long it takes read then encrypt some data (independently).
I'm trying to encrypt some content with an RSA private key. I'm following this
Trying to write a couple of functions that will encrypt or decrypt a file
I am trying to make a program that Encrypts data using AES, then encrypts
Overview: I'm trying to design an application that will encrypt files to safely send
I am trying to encrypt/decrypt an XML file. I found this sample for encrypting
Possible Duplicate: python: how to encrypt a file? I'm trying to make application that

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.