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 create a Data Segment in a DLL that can only be accessed by a valid trusted application

How to create a Data Segment in a DLL that can only be accessed by a valid trusted application

Scheduled Pinned Locked Moved C / C++ / MFC
databasec++securitycryptographytesting
2 Posts 2 Posters 1 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.
  • R Offline
    R Offline
    Rajesh_Parameswaran
    wrote on last edited by
    #1

    Hi there, I have an application which requires to read the credentials and login to the DB. Since my application runs on schedule, someone has to fed in the credentials. Storing the credentials in flat file with any encryption (including DPAPI) is not helping as the entropy will be stored in the same file and it can be easily retrieved. Thought of having the Salt for the entropy in-memory which will be key-ed in by the user through an application that will be written on a secured shared memory and the same will only be able to access by my own process (with validating the Digital signature thump print). The provision of creating the shared segment is done by a DLL and the Client process which sets the password and my process which reads the password is digitally signed and I can validate the same in the DLLMain - PROCESS_ATTACH. If the digital signature is invalid, I'm unloading the DLL by terminating the same. All worked well with LoadLibrary API and when we tried testing with LoadLibraryEx with the option: DONT_RESOLVE_DLL_REFERENCES, it was not hitting the DLLMain and was able to call all the exported functions. My query is that is there a way to securely share a data between two trusted application alone? The application is developed using C++. thanks in advance, Rajesh Iyer

    R 1 Reply Last reply
    0
    • R Rajesh_Parameswaran

      Hi there, I have an application which requires to read the credentials and login to the DB. Since my application runs on schedule, someone has to fed in the credentials. Storing the credentials in flat file with any encryption (including DPAPI) is not helping as the entropy will be stored in the same file and it can be easily retrieved. Thought of having the Salt for the entropy in-memory which will be key-ed in by the user through an application that will be written on a secured shared memory and the same will only be able to access by my own process (with validating the Digital signature thump print). The provision of creating the shared segment is done by a DLL and the Client process which sets the password and my process which reads the password is digitally signed and I can validate the same in the DLLMain - PROCESS_ATTACH. If the digital signature is invalid, I'm unloading the DLL by terminating the same. All worked well with LoadLibrary API and when we tried testing with LoadLibraryEx with the option: DONT_RESOLVE_DLL_REFERENCES, it was not hitting the DLLMain and was able to call all the exported functions. My query is that is there a way to securely share a data between two trusted application alone? The application is developed using C++. thanks in advance, Rajesh Iyer

      R Offline
      R Offline
      Rick York
      wrote on last edited by
      #2

      You can use a memory-mapped file with an obscure name. This won't prevent a hacker from being able to see the file but it will be far from obvious. You can obscure the data you place in the MMF by negating it or something simple like that. Another way is to use an interprocess communication mechanism. Some examples are pipes, sockets, the WM_COPYDATA message, and there are others. It is possible for a socket message to be intercepted but the other two are much more difficult to spoof.

      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