Hi, does anyone knows how to get the MAC address of a NIC using Lazarus/FPC on Linux?.
P.S.: I found plenty of examples using Delphi's "Nb30" unit, only for Windows.

Mailing lists / lazarus / 2010-05
18 messages · 7 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi, does anyone knows how to get the MAC address of a NIC using Lazarus/FPC on Linux?.
P.S.: I found plenty of examples using Delphi's "Nb30" unit, only for Windows.
2010/5/10 Leonardo M. :
Hi, does anyone knows how to get the MAC address of a NIC using Lazarus/FPC on Linux?.
I think the OnGuard components do this. You can find the download url from the wiki page.
http://wiki.lazarus.freepascal.org/OnGuard
Or:
http://www.silvioprog.com.br/dicas/pegaromacaddress ;)
El lun, 10-05-2010 a las 16:22 -0300, silvioprog escribi?:
Thanks!.
I'm looking for this because I'm trying to implement a licensing system to one of my products. I use it in a Delphi app and it works ok, now I'm trying to implement it for Linux. The system is this:
1) Get the MAC Address of the 1st enabled NIC, then encrypt using Rdl.
2) The user sends this encrypted string and we decrypt it to get it's MAC Address, then encrypt it again using Bf method.
3) The user has to insert this new string in the system, and it compares its MAC encrypted this time using Bf against the string the user entered, if they are equals then the license is ok.
This methods guarranties us that the software cannot be used in another machine (it's a server product).
Bf and Rdl are encryption methods used in TurboPower LockBox.
Which method do you use for licensing?
I get various informations of PC (serial disk << more important, MacAddress...), cryptographer(MD5+SHA1 and more...) and do a control algorithm myself.
Do not talk like you do, because someone can break your algorithm.
Or: http://www.silvioprog.com.br/dicas/pegaromacaddress ;) Silvio Cl?cio -…
El lun, 10-05-2010 a las 16:22 -0300, silvioprog escribi?:
Thanks!.
I'm looking for this because I'm trying to implement a licensing system to one of my products. I use it in a Delphi app and it works ok, now I'm trying to implement it for Linux. The system is this:
1) Get the MAC Address of the 1st enabled NIC, then encrypt using Rdl.
2) The user sends this encrypted string and we decrypt it to get it's MAC Address, then encrypt it again using Bf method.
3) The user has to insert this new string in the system, and it compares its MAC encrypted this time using Bf against the string the user entered, if they are equals then the license is ok.
This methods guarranties us that the software cannot be used in another machine (it's a server product).
Bf and Rdl are encryption methods used in TurboPower LockBox.
Which method do you use for licensing?
Hi, does anyone knows how to get the MAC address of a NIC using Lazarus/FPC on Linux?.…
Here is a simple example on how to read device MAC address in Linux
{$mode objfpc}
program get_mac;
uses sysutils;
const
linux_path = '/sys/class/net/%s/address';
default_device = 'eth0';
var
f : textfile;
device,
path,
addr : string;
begin
device := default_device;
if (ParamCount = 1) then
begin
device := ParamStr(1);
end;
path := Format(linux_path,[device]);
if Not FileExists(path) then
begin
writeln('Could not find the device: ', device);
halt(1);
end;
AssignFile(f, path);
reset(f);
readln(f,addr);
closefile(f);
writeln(device, ' MAC Address: ', addr);
end.2010/5/10 Leonardo M.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100510/d4978994/attachment.html>
Worked perfectely on Ubuntu 10.04. Thanks Ido ;)
Here is a simple example on how to read device MAC address in Linux {$mode objfpc}…
El lun, 10-05-2010 a las 23:54 +0300, ik escribi?:
Here is a simple example on how to read device MAC address in Linux
Thanks IK, Silvio and Graeme. I posted a reply but I think it was moderated :(. I don't know why, maybe because it contains links?.
Hm... I replied, and I received this: "Lazarus post acknowledgement".
I get various informations of PC (serial disk << more important, MacAddress...),…
Security by obscurity is no most instances it's far easier to patch it out than break it.
Brad
El lun, 10-05-2010 a las 16:22 -0300, silvioprog escribi?: Thanks!. I'm looking for this…
Leonardo M. Ram? wroteI'm looking for this because I'm trying to implement a licensing system
IMHO the only decent licensing system, that
- is (quite) safe against abuse
- does not impose a great possibility to unwillingly disallow a licensed customer to use the product
- does not impose an annoying amount of additional maintenance work to the customer (portable between PCs without any effort)
- does not impose an annoying amount of additional maintenance work to the supplier
- provides cross platform licenses
is using a USB dongle that is loadable with licensees for multiple products by multiple vendors. (AFAIK, the hardware available is by multiple companies) This is very common e.e. in the Music Software busyness (mostly Windows and Mac based products)
IMHO any software that is so cheap that it does not make sense to use a hardware dongle is not viable to be protected against miss-use by any technical means.
-Michael
2010/5/11 Michael Schnell :
is using a USB dongle that is loadable with licensees for multiple products by multiple vendors. (AFAIK, the hardware available is by
...and often way to expensive or simply not feasible. Our software product runs on 20,000+ systems. Many of them are public schools. We are constantly trying to reduce the cost of running our systems (hence the push towards Linux), so introducing a hardware device for licensing with just push up the price again (or could be stolen in schools). :-/
Software-only licensing system is cheaper, more flexible and cannot be stolen - but has its negative side too (like maybe not being as secure as a hardware device).
Graeme Geldenhuys wroteMany of them are public schools.
If I would be a manager of a school, I would not use any non-open source software anyway.
-Michael
Michael Schnell wroteOn 05/11/2010 12:19 PM, Graeme Geldenhuys wrote: > Many of them are public schools. If I would be a manager of a school, I would not use any non-open source software anyway.
Please keep your opinion to yourself if it's not related to the topic of the list.
Henry
Henry Vermaak wrotePlease keep your opinion to yourself if it's not related to the topic
:-)
-Michel
El lun, 10-05-2010 a las 16:22 -0300, silvioprog escribi?: Thanks!. I'm looking for this…
Leonardo M. Ram? wroteI'm looking for this because I'm trying to implement a licensing system
It does not make much sense to use the MAC address for enforcing a license. The MAC address the card uses can be configured in the System setup to be any value desired. Even in a Network, it's no problem using the same MAC address if the PCs dwell in different subnets.
-Michael
2010/5/11 Michael Schnell : ...and often way to expensive or simply not feasible. Our…
Graeme Geldenhuys wrote2010/5/11 Michael Schnell : > is using a USB dongle that is loadable with licensees for multiple > products by multiple vendors. (AFAIK, the hardware available is by
I worked with electronics, I was thinking about creating a USB hardlock, but soon saw that not be worth(costs) creating something with hardware, at least here in Brazil (Except if I had at least 1,000 pieces with guaranteed sale).
I agree to use software. Nothing is 100% safe (even with hardlock).