August 6th, 2002, 06:50 PM
How can encrypt document(Ms-Word) or other files except ascii text files using VC++?If we have the ascii value we could manipulate files but how can we do for a word document? I tried with my own alg. but i couldn't open even the plain text in word document?
Could anyone give me a clue of how i can do it?
August 7th, 2002, 05:49 PM
Im not sure how you could get a word file to work...
You could always just save as ASCII with line break, even if you're in Word. However, there is probably a way to do it for regular Word files. I'll try to figure it out.
August 12th, 2002, 08:01 PM
Thanks for your reply.I could get out ASCII for word files if saved in ascii format but for non-ascii files how can we encrypt.If you come across any idea or logic of doing share with me.
August 12th, 2002, 08:13 PM
If you're simply making your own algorythm in c++, open the file in a binary mode, take the integer value of each character when you read them in 1 at a time, then do your work on the data. the file itself will be complete giberish and won't open with formatting in word if you encrypt the file as a whole, not just the text inside it, it will open as an ascii text file and just display everything in it. But most encryption programs don't intend to make the file exactly the same as the original, unless you have the method to decrypt it then you shouldn't be worrying about it anyways.
Reality is the one who has it wrong, not you
August 12th, 2002, 08:24 PM
I suggest you take a look at Microsoft's CryptoAPI:
Google has some additional links, but you'll find using a Cryptographic Service Provider is much easier than programming your own cryptography methods and functions (I know, I had to do RSA encryption for my Data Structures and Algorithms class).
\"It\'s only arrogrance if you can\'t back it up, otherwise it is confidence.\" - Me
August 13th, 2002, 01:33 AM
Using PGP or Blowfish there are both standalone and DLL versions that will encrypt binary or ACSII files. Using any search engine should get you what you need.
Work... Some days it's just not worth chewing through the restraints...