How to encrpyt a file and decrpyt on the fly
-
Hello All, I have a program which uses a XML file for initialisation of the program. Now i have to make that XML file scrambled or decoded in order to give to the end user. (it was not required in the beginning of the project) How can i encrypt a file(since i need to modify couple of other files not just an XML file) and decrpyt on the memory without creating a temporary decrypted file? Actually i can encrypt the file but i don't know how to decrypt the file on the memory into a text-based XML file and then use it as i used to do. can Memory File Mapping be used for this? (i just heard it but never used) or is there any other simple way? I am currently using TinyXML and standard C++ streams for data reading. Thanks
-
Hello All, I have a program which uses a XML file for initialisation of the program. Now i have to make that XML file scrambled or decoded in order to give to the end user. (it was not required in the beginning of the project) How can i encrypt a file(since i need to modify couple of other files not just an XML file) and decrpyt on the memory without creating a temporary decrypted file? Actually i can encrypt the file but i don't know how to decrypt the file on the memory into a text-based XML file and then use it as i used to do. can Memory File Mapping be used for this? (i just heard it but never used) or is there any other simple way? I am currently using TinyXML and standard C++ streams for data reading. Thanks
beko wrote:
How can i encrypt a file...
Have you considered the Crypto API? (CRAPI)? Have you checked for articles here on CP? Have you Googled for examples?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
beko wrote:
How can i encrypt a file...
Have you considered the Crypto API? (CRAPI)? Have you checked for articles here on CP? Have you Googled for examples?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
i didn't look at the Crpyto API,however i have done encrpytion of a file before. That was not a problem, it was a license file and i was encrypting and writing to a file and reading as binary, checking the date etc. (i searched in google and codeproject about encryption before doing this) now i am going to look at Crypto API, i have seen two articles on codeproject. Thanks for the pointer.