How to start

Post here any topics that related to Enigma Protector, its functionality, your misunderstanding, offers to improvements etc etc etc
Post Reply
Posts: 2
Joined: Tue Apr 28, 2009 7:15 am

How to start

Post by mihaelamj » Tue Apr 28, 2009 7:29 am


I just registered The Enigma Protector, and I'm looking for a quick start info. I'm using Delphi 2009.
I would like to protect my app with just basic username/password combo. The app should also be time limited for 30/60 days without registration.
I'm also applying for Share-It, and don't know where to start.
On their apply program there's no where to be found an option to send them a key generator. They only offer uploading the application or list of license keys.
So my question is how do I do it?

Do I first protect the app with Enigma and then check for valid username/password with source code?
I would like to use my own dialogs for reminding the user and for entering the registration data.

Please help.

Mihaela MJ

Site Admin
Posts: 2554
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to start

Post by Enigma » Tue Apr 28, 2009 8:35 am

Hi Mihaela, ok, let's start from zero, I will explain everything!

Firstly, the protection begins not from Enigma but from license scheme. Usually I recommend to use 2 kinds of your applications:
1. DEMO version, this version is distributing to any user, it is allowed to download from your site, it does NOT require registration and the main thing - it has restricted functionality (to stimulate users to buy the full version)
2. FULL version, you distributing this version to REGISTERED users only and this version allows to register.

The common license scheme could look:
1. User download DEMO version
2. Due to restricted functionality user decides to buy program
3. User goes to Shareit and buy a license
4. Immediately user gets link to full version + registration key
5. User downloads full version, enter license information (registration name + key) and register.

The above scheme, to my mind, is the best and easy.

Now back to your needs. You need to limit application to 30/60 days, it means that this version will be full functional, just limited to some days? I do not recommend to use this, the best way is to limit usage for some days + restrict functionality. Let's think it is a DEMO version, how to protect it:
1. Create new project in Enigma, it is VERY important step!
2. Enter Application name and version in Input panel, this is important step too!
3. Select file to protect in Input panel and output (protected file) on Output panel
4. Now, setup trial, go to TRIAL CONTROL - Limitation of days count, enable this feature, set up number of days (30 for eg.). If you want to check trial yourselves, uncheck option "Terminate execution after", in this case you will need to check trial manually, Enigma will not warn if trial expires. if "Terminate execution after" is checked, then you "maybe" do not need #5 and #6.
Please do not forget that while testing you will need to reset Trial and/or Registration information, for this use MainMenu - Tools - Debug features
5. As you are checking trial manually, it is possible by means Enigma API, you have to add to your project enigma_ide.pas module, you can find it in installation folder, EnigmaSDK\Delphi folder. Then, we need to check trial, somewhere on the application start or on main form create event write a code:

Code: Select all

  Total, Left : cardinal;
// Check, if trial is set up and did not expire
if EP_TrialDays(Total, Left) then
  // If left days > 0 then we can continue
  if Left > 0 then
// Here we fail, just exit;
This code checks trial and if it did not expire then we complete execution, otherwise - shot down. Please nmodify this code by your needs.
6. When you add code #5, and will try to run application you will get an error that enigma_ide.dll is not found find this dll into EnigmaSDK\Delphi folder and copy in the same folder as main executable. Note, all Enigma API fail without protecton, once you protect this executable - everything will work well.

Ok, we created DEMO version, now back to full version that allows registration
1. Create new project in Enigma, it is VERY important step! // Same
2. Enter Application name and version in Input panel, this is important step too! // Same
3. Select file to protect in Input panel and output (protected file) on Output panel // Same
4. Setup necessary registration key properties, go to REGISTRATION FEATURES - Common panel. Here you can select properties of registration keys which will be used for registration. I recommend Key base = Base 32, Key safety - you may select it yourselves, RSA 1024 is good and enough.
5. As you want to check registration manually, you have to use enigma_ide.pas and it's registration functions. As you are using Delphi 2009, Enigma has little restriction with D2009, modify enigma_ide.pas and replace all PChar types to PAnsiChar.
For example:

Code: Select all

function EP_RegCheckAndSaveKey(Name : PChar; Key : PChar) : boolean; external enigma_api_dll_name name 'EP_RegCheckAndSaveKey';

Code: Select all

function EP_RegCheckAndSaveKey(Name : PAnsiChar; Key : PAnsiChar) : boolean; external enigma_api_dll_name name 'EP_RegCheckAndSaveKey';
Add this module to your delphi project.
6. As you want to check registration manually, you need a dialog that will allow to enter registration data, registration name and registration key. Create such dialog, simply, there are only 2 fields for name and key and one/two button(s) - "Register"
7. In Register button click enter such code:

Code: Select all

if EP_RegCheckAndSaveKey(PAnsiChar(RegName.Text), PAnsiChar(RegKey.Text)) then
  // Application is registered.
  ShowMessage('Thanks for registration');
To check registration you should use EP_RegLoadAndCheckKey, if it returns true then application is registered.
8. I suggest to use crypted sections in your application, i.e. RegCrypt markers, please take a look at manual. Such markers allow to define a parts of code that should be executed only when application is registered and necessary section in unlocked in registration key. Simply, how it works:
you mark some code inside your application with:

Code: Select all
markers, then generate a registration key with "section 1" checkbox. Application registerd with such key will allow to run the code inside this marker. But, if you generate a key without "section 1" then code inside markers will not be executed after registration. Note, if you use reg crypt markers, then application should be restarted after registration.

We created full version, ok!

Now need to automate it with Shareit keygen:
1. As you remember, we are using DEMO and FULL version, so, after purchase the user should get a link to full version firstly. This is not a problem, shareit allows to show custom html page after a registration, enter in this page a link to full version.
2. Keys generator, everything is written there
after you created this keygen, just send it to shareit support team by email (as written at the end of above tutorial).

Write me back if you will need more detailed help!

Posts: 2
Joined: Tue Apr 28, 2009 7:15 am

Re: How to start

Post by mihaelamj » Tue Apr 28, 2009 8:52 am

This is great.
You're awesome.
I'll read it now, just wanted to thank you for your effort.

Post Reply