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. COM
  4. Secure COM DLL

Secure COM DLL

Scheduled Pinned Locked Moved COM
comsecuritycryptographyregexquestion
3 Posts 3 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.
  • A Offline
    A Offline
    antoine_boillier
    wrote on last edited by
    #1

    Hi, Does somebody know a secure solution to ensure that the DLL an application is talking to hasn't been replaced with a fake one? I am thinking about implementing a "handshaking" procedure. With this method, the application sends a "challenge" random message to the DLL. The DLL responds with a value calculated using a one-way hash function. The application checks the response against its own calculation of the expected hash value. If the values match, the authentication is acknowledged; otherwise the application is terminated. Do you know other/better solutions? Does COM provides some solution? Remark: I am developing both the application part and the DLL part. Thanks. antoine

    G J 2 Replies Last reply
    0
    • A antoine_boillier

      Hi, Does somebody know a secure solution to ensure that the DLL an application is talking to hasn't been replaced with a fake one? I am thinking about implementing a "handshaking" procedure. With this method, the application sends a "challenge" random message to the DLL. The DLL responds with a value calculated using a one-way hash function. The application checks the response against its own calculation of the expected hash value. If the values match, the authentication is acknowledged; otherwise the application is terminated. Do you know other/better solutions? Does COM provides some solution? Remark: I am developing both the application part and the DLL part. Thanks. antoine

      G Offline
      G Offline
      geo_m
      wrote on last edited by
      #2

      COM itself doesn't provide any solution for this (somehow you can use Licencing, but it is very easy to break). Your solution can work, but have one weakpoint - it is quite easy to crack, because when the someone would like to switch the DLLs, he needs only to know the one-way hash you are using - if you will choose some standardized, say MD5, he can only with this knowledge calculate correct hash and return it to you exactly as your original DLL does. It is in fact secured only by the alg. of the one-way hash, and this alg. is stored in exe as well as in the DLL, so everybody can look to it and copy it. Little bit better is a signing the code. If you will use the public key cryptography, the theory is simple, you have to calculate the cryptographic checksum of the DLL. Then the hash result is signed by your private key and stored in DLL. In runtime, you take this blob from the DLL, calculate hash (of course except modified parts), compare it with the stored one and verify the signature by your public key stored say in a resources of the exe file. If the hashes match and the signature is OK, you are on the safe side. This method is a bit safer, but also have some problem. It is quite easy to remove the checking code from exe ;). In fact, there is no perfect software solution and depends only on the level of security you require for your application. But in any case, there is a simple helper rule which says, if the system is secured, independently on the method you will use - If the costs for breaking such a system is higher (better significantly higher) than the benefits you can have from it, the system can be considered as safe. Sorry for such an elaborate, but it is a deep night here and I cannot sleep somehow today... :-D

      1 Reply Last reply
      0
      • A antoine_boillier

        Hi, Does somebody know a secure solution to ensure that the DLL an application is talking to hasn't been replaced with a fake one? I am thinking about implementing a "handshaking" procedure. With this method, the application sends a "challenge" random message to the DLL. The DLL responds with a value calculated using a one-way hash function. The application checks the response against its own calculation of the expected hash value. If the values match, the authentication is acknowledged; otherwise the application is terminated. Do you know other/better solutions? Does COM provides some solution? Remark: I am developing both the application part and the DLL part. Thanks. antoine

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        Forget dynamic linking if you want security. There are about 1001 different ways of intercepting a dynamically loaded DLL. X| To make it as hard as possible, do static linking. At least then you put the cracker to work. :) To be real pessimistic, there is no real way to protect software in currently available mainstream operating systems. Nobody has a rigid set of security policies implemented. There will always be ways to trick the system, some harder than others. -- we dance to the sound of sirens and we watch genocide to relax we dance to the sound of sirens we are the heroes of self-deception

        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