Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to encrpyt a file and decrpyt on the fly

How to encrpyt a file and decrpyt on the fly

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++xmlperformancetutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    beko
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • B beko

      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

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      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

      B 1 Reply Last reply
      0
      • D David Crow

        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

        B Offline
        B Offline
        beko
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups