?
Solved

How do I encrypt a richtextbox without loosing the format?

Posted on 2003-02-26
6
Medium Priority
?
351 Views
Last Modified: 2010-05-01
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
Comment
Question by:igfp
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:Rhaedes
ID: 8028963
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
 
LVL 2

Accepted Solution

by:
ascii236 earned 200 total points
ID: 8029847

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
 

Author Comment

by:igfp
ID: 8032035
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:igfp
ID: 8032057
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
 

Author Comment

by:igfp
ID: 8040995
It helped me a lot. Specially the Rich Text tags Thank You!
0
 
LVL 2

Expert Comment

by:ascii236
ID: 8043783
:)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question