Share

TurboPower OnGuard

Tracker: Feature Requests

5 Verify registration against code (Solution inside) - ID: 1704810
Last Update: Tracker Item Submitted ( mischerr )

I want to make sure that the user enters the correct company name where the
code is registered to.

The code is generated in an external app by entering a company name and a
expiration date.

In the main app, the user has to enter the company name (owner of the
registration) and the related key.


Here my solution (you can copy& paste it into OnGuard.pas):


function IsRegCodeRegisteredTo(const Key : TKey; const Code : TCode; const
RegStr : string) : Boolean;
var
Work : TCode;
S : string;
I,
RegString: Integer;
begin
Work := Code;
MixBlock(T128bit(Key), Work, False);
{strip accented characters from the registration string}
S := RegStr;
for I := Length(S) downto 1 do
if Ord(S[I]) > 127 then
Delete(S, I, 1);
RegString:= StringHashElf(AnsiUpperCase(S));
Result := Work.RegString = RegString;
end;


Michael Scherr ( mischerr ) - 2007-04-21 12:10

5

Open

None

Nobody/Anonymous

None

None

Public


Comments

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.