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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:06:39+00:00 2026-06-04T09:06:39+00:00

I have a requirement to programmatically encrypt portions of a plain text file in

  • 0

I have a requirement to programmatically encrypt portions of a plain text file in a C# application, and ensure that the data, when unencrypted, cannot be easily intercepted in memory (this may provide challenging, as there is always some point where the raw data will be handled in decrypted form).

It should be possible to unencrypt the data either by means of a password encrypted in the file or ideally via a private key. One requirement is to allow each encrypted block to be protected by a unique key pair, such that a private key decrypts a subset of the encrypted whole.

I am thinking of using RSACryptoServiceProvider or some other asymmetric cryptography scheme available in .Net 4.0. I am proceeding with caution as the scheme must be rock-solid, and would not be averse to using an external library if there are compelling reasons for this.

I am also interested in established techniques for maintaining encryption in-memory, in order to prevent runtime heap-walking as a means to intercept unencrypted data.

Thanks in advance.

  • 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-04T09:06:40+00:00Added an answer on June 4, 2026 at 9:06 am

    For an example of how RSACryptoServiceProvider works, I can only direct you to its MSDN page that has a very complete usage example.

    For secure storage of a string in memory, you can use System.Security.SecureString:

    SecureString Class :
    Represents text that should be kept confidential. The text is encrypted for privacy when being used, and deleted from computer memory when no longer needed.

    However please keep in mind that any person sufficiently skilled and / or motivated will always manage to eventually break the protections you have set.

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

Sidebar

Related Questions

I have following requirement, I have C#/.Net console application, which refers to 'System.Data.Sqlite.dll' 'System.Data.Sqlite.dll'
I have a requirement to programmatically add a file along with metadata to a
I have an VB.Net/C# application that programmatically: Creates an RTF document Open it up
I have requirement as following like showing ABPeoplePickerNavigationController in tabbar based application. I researched
In our project we have requirement that, after receiving sms message from third party
I have a requirement to write HTML to the file system and I was
I need to programmatically parse and transform ASP.NET webform pages. It's a requirement that
In a Mac application, I have a requirement to store the private key sent
I have a requirement where I need to create a dojox.layout.ContentPane programmatically. function constructContentPane(methodToBeCalled){
We have a large C# application which is deployed using an .MSI file which

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.