Dongle Lock

   I have an  executable program (exe). I dont have the source code.

 Can I lock this Exe with a dongle ??

 If possible then how do i do it ?

Who is Participating?
lbertaccoConnect With a Mentor Commented:
Yes. Most dongle vendors give you 3 things: the dongle itself, a library that let you verify the presence of the dongle from within you source code AND a program that just takes an existing exe  and modify it so that it runs only if the dongle is present.
In general, if you use the library function you can achieve better security, but if you don't want to bother or don't have the source code you can just "protect" the executable.

The exececutable is usually encrypted and modified so that upon startup it checks for the presence of the dongle and if it finds one it asks the dongle to decrypt the rest of the program. So if you don't have the dongle, you can't run the program nor disassemble it (in theory).

Note that some vendors don't support ANY exe, but just some (usually those compiled with microsoft compilers).
For example, my version of Hardest crashes when protecting programs compiled with cygwin g77; Rainbow Sentinel also seem to have problems witht DLL generated in Cygwin. Wibu-Key from WibuSystem has been able to protect any win32 (PE Format) exe I throw at it up to now (including those on which Sentinel and Hardest failed) - also I think they can send you a demo unit for free (at least they used to).

You can lock it with a dongle as lbertacco stated, but using the method he mentioned will result in a drastic performance hit within the application. Wrapping an EXE and then making it look for specific hardware on start up will freeze up all but the newest computers. Your customers will not appreciate it, especially if they paid for something that is truly worth a dongle(i.e. EXPENSIVE)!

Well I don't know exactly what mugman21 mean, but checking for the presence of a serial, parallel or USB dongle plus decrypting the exec takes just a fraction of a second and you won't notice it even on very old hardware (even old 386)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.