PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
Serialisation
Serialisation
Started by romuald besset, Aug., 07 2003 6:05 PM - 1 reply
Connect yourself…
romuald besset
#1
Posted on August, 07 2003 - 6:05 PM
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
Report
0
0
Guenter Predl
#2
Posted on August, 07 2003 - 10:41 PM
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
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text