• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 354
  • 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.
0
igfp
Asked:
igfp
  • 3
  • 2
1 Solution
 
RhaedesCommented:
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,
Rhaedes
0
 
ascii236Commented:

Ok, I wrote you a small app.

http://dryrtf.freewebspace.com/

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)
0
 
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:
ig_35646_fp@hotmail.com
I'm considering to try Rhaedes code. I'm supposed to save it without the SaveFile, using a print right?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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.
0
 
igfpAuthor Commented:
It helped me a lot. Specially the Rich Text tags Thank You!
0
 
ascii236Commented:
:)
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

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