-
cryptography
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?
Chokks
-
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.
-
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.
Chokks.
-
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.
-
I suggest you take a look at Microsoft's CryptoAPI:
http://discuss.microsoft.com/archives/cryptoapi.html
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).
Regards,
Wizeman
-
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.