• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

How do I encrypt a richtextbox without loosing the format?

I'm trying to encrypt a richtextbox when I save it. I don't want to loose the format of the text I have.
Also I want to decode it to the richtext box when I open the file.
Anyone has any idea?
Any code is fine, it can be lame, the important thing is that the end user wont use the file outside of the program.
Thank you everyone.
  • 3
  • 2
1 Solution
You want lame? Here's lame: just save the file with a '.exe' or '.dll' extension. None but the most intrepid of hackers would ever consider trying to open such a file... You want to get hard core, zip the file first then save it with one of these extensions. Otherwise just loop through each character in the TextRTF and add one to all the ascii codes. All pretty lame I know... it just depends on how much security you need.
In fact, the TextRTF is pretty esoteric as it stands, but if you need something better, I've written some code that compares a file with a random stretch of the Old Testament (or any long text string) and encodes accordingly. You have to provide the starting character number to decode.

Kindest regards,

Ok, I wrote you a small app.


The file is DryRTF.zip
there is a link on the page.

let me know if you cant get it, I created that free website just for you. (sorry about the adds, but its free)
igfpAuthor Commented:
Sorry ascii236, I can't get the zip out. It says that it's not available. maybe you could send it to my e-mail:
I'm considering to try Rhaedes code. I'm supposed to save it without the SaveFile, using a print right?
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

igfpAuthor Commented:
I've tried again and again and I have the zip already, I will see the code in like 5 hours. Then I'll get back to you. Thank you.
igfpAuthor Commented:
It helped me a lot. Specially the Rich Text tags Thank You!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now