PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Re: Serialisation
Re: Serialisation
Débuté par RB, 19 aoû. 2003 15:14 - Aucune réponse
Posté le 19 août 2003 - 15:14
Hi Guenter,
Sorry for the late answer, and thanks for it. You understood well.
As a escaped from IE suite for my web reading (to start with mozilla), I also went in usenet newsgroups. Then i obtained a well thought hash algorithm I adapted for my numeric values (simply by converting in litteral to get key modification even with a simple +1. il gives a more than +1 ascii difference and gives a different key )
PS : For us NG publications, have you thought it could be a lack of moderator (hollidays) ?
greetings.
R&B

Hi Romuald, I hope, I am right in that you want to convert a customers name into a unique serial number? If so, do the following
X is string = "Software Buyers & Pinchers Ltd."
Sum is long int = 0
FOR I = 1 TO LENGTH(X)
Sum = Sum + Asc(Middle(X, I, 1))
END
You'd end up with a unique number stored in Sum but there's quite a lot of names fitting that number. So we'd have to make our number a little more 'unique'. Just an example:
Sum = Sum + Asc(Middle(X, I, 1))*I
This way we bind position and value. Even large text-fields would boil down to relatively small Sums (=serial numbers). However, in order to prevent finding out, you should allow a certain minimum length of X only. Short strings will enable a hacker to guess the number more easily. Of course, there are a lot of ways to improve on the algorithm, f.i. Sum = Sum + Asc(Middle(X, I, 1))*I + I\2 (fyi: the '\' is right, this's an integer division in WD like in many BASICs)
Maybe, you think 'Asc' alone is too simple. Make it a binary exclusive OR with a random text exactly as long as the longest string could be.
Every algorithm for calculating a serial number can be broken, it's just a question of the effort put into breaking. So, your algorithm will depend on the price of the program and other influencing facts ..
We did go into this and found out that WinDev is much more secure than any compiled language. The source is in the delivered exe, but it's p-code there, not machine language which could be disassembled easily.
Best regards,
Guenter



HI
Hi need to create a # serial builder.
serial is build from a 100 chars string.
I need to obtain a 7 chars max #serial.
wd exaples show how to crypt bu not how to obtain a small key...
Of course a simply reverse of two consecutive chars must give a different key !!!
A big big thank to how will be able to help
http://rbesset.net



rbesset.net : french unofficial windev gate