Re: how to detect MAC address

Discussion in 'Java' started by Roedy Green, Jul 1, 2003.

  1. Roedy Green

    Roedy Green Guest

    On Thu, 26 Jun 2003 15:25:01 -0400, Sudsy <>
    wrote or quoted :

    >I'm amazed by how many times this topic arises. I can only surmise
    >that people are trying to use the MAC address for some licensing
    >scheme.


    If you want a unique serial number, you can get the CPU serial number.
    The assembler source for it is posted at
    http://mindprod.com/products.html#CPUSER

    I could wrap it in JNI for you if you want.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 1, 2003
    #1
    1. Advertising

  2. Roedy Green <> scribbled the following:
    > On Thu, 26 Jun 2003 15:25:01 -0400, Sudsy <>
    > wrote or quoted :
    >>I'm amazed by how many times this topic arises. I can only surmise
    >>that people are trying to use the MAC address for some licensing
    >>scheme.


    > If you want a unique serial number, you can get the CPU serial number.
    > The assembler source for it is posted at
    > http://mindprod.com/products.html#CPUSER


    > I could wrap it in JNI for you if you want.


    What about platforms that DON'T have CPU serial numbers? AFAIK Java
    supports those. Heck, Sun makes a reference implementation for Sun
    SPARC, and AFAIK that particular processor family does not understand
    Pentium III serial number requests. (Gee, wonder why?)
    There might even be platforms that don't have *CPUs* in the first place.
    Currently there are no such platforms but it isn't entirely
    inconceivable that some might exist in the future. And I thought Java
    was supposed to be cross-platform?

    --
    /-- Joona Palaste () ---------------------------\
    | Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
    | http://www.helsinki.fi/~palaste W++ B OP+ |
    \----------------------------------------- Finland rules! ------------/
    "It sure is cool having money and chicks."
    - Beavis and Butt-head
    Joona I Palaste, Jul 1, 2003
    #2
    1. Advertising

  3. Roedy Green

    Sudsy Guest

    Roedy Green wrote:
    > On Thu, 26 Jun 2003 15:25:01 -0400, Sudsy <>
    > wrote or quoted :
    >
    >
    >>I'm amazed by how many times this topic arises. I can only surmise
    >>that people are trying to use the MAC address for some licensing
    >>scheme.

    >
    >
    > If you want a unique serial number, you can get the CPU serial number.
    > The assembler source for it is posted at
    > http://mindprod.com/products.html#CPUSER


    Roedy,
    I wouldn't want or even try to obtain a MAC address from Java.
    It's just a pet peeve of mine that people think that they should
    be able to do absolutely everything in one language.
    Don't get me wrong: I love Java! So many classes and extensions,
    so simple to do so many things. But it's not the right tool for
    every job. Even Sun used to warn about not using Java for mission-
    critical applications.
    BTW, not every processor has a serial number.
    Sudsy, Jul 1, 2003
    #3
  4. Roedy Green

    Amey Samant Guest

    Sudsy <> wrote in message news:<>...
    > I wouldn't want or even try to obtain a MAC address from Java.
    > It's just a pet peeve of mine that people think that they should
    > be able to do absolutely everything in one language.
    > Don't get me wrong: I love Java! So many classes and extensions,
    > so simple to do so many things. But it's not the right tool for
    > every job. Even Sun used to warn about not using Java for mission-
    > critical applications.


    hi there
    i know that but i wonder if they give you the choice about platform
    even in your organisation.....
    i know such things can best be handled by lower rather (mid) level
    language such as c ....
    but if im doing a project & client wants to detect MAC address & he
    wants it to be an applet

    rgards
    Amey
    Amey Samant, Jul 2, 2003
    #4
  5. Amey Samant <> scribbled the following:
    > Sudsy <> wrote in message news:<>...
    >> I wouldn't want or even try to obtain a MAC address from Java.
    >> It's just a pet peeve of mine that people think that they should
    >> be able to do absolutely everything in one language.
    >> Don't get me wrong: I love Java! So many classes and extensions,
    >> so simple to do so many things. But it's not the right tool for
    >> every job. Even Sun used to warn about not using Java for mission-
    >> critical applications.


    > hi there
    > i know that but i wonder if they give you the choice about platform
    > even in your organisation.....
    > i know such things can best be handled by lower rather (mid) level
    > language such as c ....
    > but if im doing a project & client wants to detect MAC address & he
    > wants it to be an applet


    Then I guess your client is asking too much. The only way for Java to
    get a MAC address is to use JNI, and I don't know if applets (unsigned
    ones, at least) are allowed to use JNI at all. Tell your client that
    there is more to Java than applets. Our company, for instance, is not
    implementing our server-side database monitoring system as an applet.

    --
    /-- Joona Palaste () ---------------------------\
    | Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
    | http://www.helsinki.fi/~palaste W++ B OP+ |
    \----------------------------------------- Finland rules! ------------/
    "That's no raisin - it's an ALIEN!"
    - Tourist in MTV's Oddities
    Joona I Palaste, Jul 2, 2003
    #5
  6. Roedy Green

    Roedy Green Guest

    On 1 Jul 2003 18:34:49 GMT, Joona I Palaste <>
    wrote or quoted :

    >There might even be platforms that don't have *CPUs* in the first place.
    >Currently there are no such platforms but it isn't entirely
    >inconceivable that some might exist in the future. And I thought Java
    >was supposed to be cross-platform?


    Perhaps eventually all machines will have a unique ID, either from
    hardware, or by a process similar to generating a 128-bit private key.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 2, 2003
    #6
  7. Roedy Green

    Roedy Green Guest

    On Wed, 02 Jul 2003 19:31:27 GMT, Roedy Green <>
    wrote or quoted :

    >Perhaps eventually all machines will have a unique ID, either from
    >hardware, or by a process similar to generating a 128-bit private key.


    I was surprised to discover my new Athlon CPU does not suport the
    CPUID level 3 instruction to get a unique serial number. It does not
    have one.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 3, 2003
    #7
  8. Roedy Green

    Tim Jowers Guest

    Joona I Palaste <> wrote in message news:<bdu0i2$lee$>...
    > > Sudsy <> wrote in message news:<>...
    > >> I wouldn't want or even try to obtain a MAC address from Java.
    > >> It's just a pet peeve of mine that people think that they should

    >
    > Then I guess your client is asking too much. The only way for Java to
    > get a MAC address is to use JNI, and I don't know if applets (unsigned


    ... sounds to me like a weakness or future requirement of Java. Any
    regular user mode app can talk to a driver so a Java app should be
    able to also. Specifically in this case we are talking about raw
    ethernet packets instead or IP packets. Is is true I can make IP
    packets in Java without making TCP or UDP?

    Requirement: JVM needs to abstract interface to drivers/devices.
    Now we are talking true platform independence. Isn't this already
    being done? Doesn't someone know?

    Tim

    P.S> My current project finds me writing code in Java, javascript,
    VB6, C, and Cobol. Talk about using the right (or wrong!) language for
    the right task.
    Tim Jowers, Jul 3, 2003
    #8
  9. Tim Jowers <> scribbled the following:
    > Joona I Palaste <> wrote in message news:<bdu0i2$lee$>...
    >> > Sudsy <> wrote in message news:<>...
    >> >> I wouldn't want or even try to obtain a MAC address from Java.
    >> >> It's just a pet peeve of mine that people think that they should

    >>
    >> Then I guess your client is asking too much. The only way for Java to
    >> get a MAC address is to use JNI, and I don't know if applets (unsigned


    > .. sounds to me like a weakness or future requirement of Java. Any
    > regular user mode app can talk to a driver so a Java app should be
    > able to also. Specifically in this case we are talking about raw
    > ethernet packets instead or IP packets. Is is true I can make IP
    > packets in Java without making TCP or UDP?


    Are you aware that applets and apps are different things? A Java
    app (i.e. application) can use JNI to talk to whatever it bloody wants
    to. A Java applet, on the other hand, operates within a security
    sandbox.

    --
    /-- Joona Palaste () ---------------------------\
    | Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
    | http://www.helsinki.fi/~palaste W++ B OP+ |
    \----------------------------------------- Finland rules! ------------/
    "'It can be easily shown that' means 'I saw a proof of this once (which I didn't
    understand) which I can no longer remember'."
    - A maths teacher
    Joona I Palaste, Jul 3, 2003
    #9
  10. Roedy Green

    Sudsy Guest

    Roedy Green wrote:
    > On Wed, 02 Jul 2003 19:31:27 GMT, Roedy Green <>
    > wrote or quoted :
    >
    >
    >>Perhaps eventually all machines will have a unique ID, either from
    >>hardware, or by a process similar to generating a 128-bit private key.

    >
    >
    > I was surprised to discover my new Athlon CPU does not suport the
    > CPUID level 3 instruction to get a unique serial number. It does not
    > have one.


    Roedy,
    Why does this surprise you? Have you not been in the business long
    enough to remember the brouhaha which came about when Intel first
    started surreptitiously adding serial numbers to their CPUs? And then
    people discovered that even more chips had gone out with serial
    numbers than Intel at first admitted?
    It's all about privacy, which is why I only use AMD chips these
    days. This is not news, it's "olds". That's why I and others have
    been saying that you can't rely on a CPU serial number or a MAC
    address in order to implement a licensing scheme.
    That's also why I don't think Sun did anything wrong by failing
    to provide a mechanism for retrieving interface hardware addresses.
    Next thing people would be asking for would be a method which would
    allow them to change it! ;-)
    As always, YMMV.
    Sudsy, Jul 3, 2003
    #10
  11. Roedy Green

    Sudsy Guest

    Roedy Green wrote:
    > On Thu, 03 Jul 2003 11:31:10 -0400, Sudsy <>
    > wrote or quoted :
    >
    >
    >> Why does this surprise you? Have you not been in the business long
    >>enough to remember the brouhaha which came about when Intel first
    >>started surreptitiously adding serial numbers to their CPUs? And then
    >>people discovered that even more chips had gone out with serial
    >>numbers than Intel at first admitted?

    >
    >
    > I was lobbying FOR such numbers long before Intel implemented them.
    > Then the fuss seemed to die down. I thought it was all over but the
    > shouting. Intel's scheme allowed you to defang it if you wanted.


    They SAID that you could run a small program to disable it but a
    number of nerds demonstrated that it was still possible to retrieve
    the serial number. Check out this page:

    www.bigbrotherinside.org

    I have joined the boycott. You and I obviously have different
    opinions as to the value of such a mechanism. I'm wearing my user
    hat and worry about invasions of privacy. You've apparently donned
    a developer hat and are attempting to protect your intellectual
    property. Different strokes and all...
    Sudsy, Jul 3, 2003
    #11
  12. Roedy Green

    Tim Jowers Guest

    Joona I Palaste <> wrote in message news:<be17eo$hnl$>...
    > Tim Jowers <> scribbled the following:
    > > Joona I Palaste <> wrote in message news:<bdu0i2$lee$>...
    > >> > Sudsy <> wrote in message news:<>...
    > >> >> I wouldn't want or even try to obtain a MAC address from Java.
    > >> >> It's just a pet peeve of mine that people think that they should
    > >>
    > >> Then I guess your client is asking too much. The only way for Java to
    > >> get a MAC address is to use JNI, and I don't know if applets (unsigned

    >
    > > .. sounds to me like a weakness or future requirement of Java. Any
    > > regular user mode app can talk to a driver so a Java app should be
    > > able to also. Specifically in this case we are talking about raw
    > > ethernet packets instead or IP packets. Is is true I can make IP
    > > packets in Java without making TCP or UDP?

    >
    > Are you aware that applets and apps are different things? A Java
    > app (i.e. application) can use JNI to talk to whatever it bloody wants
    > to. A Java applet, on the other hand, operates within a security
    > sandbox.

    Yes. A sandboxed applet should not be able to do this. I shouldn't
    have to write C because Java hasn't provided something it could. Can
    you imagine me saying to a C# programmer they are going to have to
    write C? But maybe this is the same in C#.
    Tim Jowers, Jul 4, 2003
    #12
  13. On Thu, 03 Jul 2003 04:55:41 -0700, Tim Jowers wrote:

    >> Then I guess your client is asking too much. The only way for Java to
    >> get a MAC address is to use JNI, and I don't know if applets (unsigned

    >
    > .. sounds to me like a weakness or future requirement of Java. Any
    > regular user mode app can talk to a driver so a Java app should be
    > able to also. Specifically in this case we are talking about raw
    > ethernet packets instead or IP packets. Is is true I can make IP
    > packets in Java without making TCP or UDP?


    No.

    > Requirement: JVM needs to abstract interface to drivers/devices.
    > Now we are talking true platform independence. Isn't this already
    > being done? Doesn't someone know?


    The JVM does abstract it - to the point of giving you Socket and
    DatagramSocket and InetAddress. All so nicely abstracted that it works
    even on systems that do not HAVE a MAC address, like my PC (my modem
    doesn't have a MAC address). BTW, what 's the MAC address of your mobile
    phone?

    You seem to be wanting to remove or bypass the abstraction, something that
    requires a lower level and more platform dependent language.

    Steve
    Steve Horsley, Jul 4, 2003
    #13
  14. Roedy Green

    Amey Samant Guest

    i totally agree with Tim .....
    they should provide something for it in j2se itself (excluding JNI)
    if they can provide the Name of the network card interface ... they
    should exploit it to go detailed descr than just name .....
    as far roedy says that token ring may not have MAC address .... then
    they can also provide APIs to check wat kinda standard 802.* is set up
    & always handle the exception cases. there is a definite scope for
    growth in this for j2se as today netowrks are growing increasingly
    even at home user level.
    its quite impressive to see the development(growth) in security area
    from 1.3.* to todays version 1.4.*

    wat u say ?

    regards
    amey
    Amey Samant, Jul 4, 2003
    #14
  15. Roedy Green

    Roedy Green Guest

    On Thu, 03 Jul 2003 13:20:48 -0400, Sudsy <>
    wrote or quoted :

    >You've apparently donned
    >a developer hat and are attempting to protect your intellectual
    >property.


    When I came up with the idea of a CPU serial number many years ago I
    was trying to invent a pain free copy protection scheme that did not
    interfere with backups, and that allowed you to change your
    configuration without disturbing it. I was not thinking about
    privacy.

    I still don't think I understand the privacy issue. I can see
    protecting your identity when you browse the web, but it seems to me a
    vendor has to know who you are if you want a paid update or software
    rental service.


    My goal is that I could be able to use any software I want at any
    time, and just pay a lump fee depending on what I actually used. I
    don't think I should have to pay any substantial amount just for
    having a program on tap or one that I use only once a year or one I no
    longer use.

    see http://mindprod.com/projsoftwarerental.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 4, 2003
    #15
  16. Roedy Green

    Sudsy Guest

    Roedy Green wrote:
    > On Fri, 04 Jul 2003 09:42:08 -0700, "Jon A. Cruz" <>
    > wrote or quoted :
    >
    >
    >>There are some problems with this in regards to upgrades, etc. Which is
    >>partially why Sun machines had a serial number but not in the CPU itself.

    >
    >
    > You would have to reregister when the cpu changed, but that is fairly
    > rare. Current schemes reregister if ANYTHING changes at all about
    > your config. Reregistering is no longer such a big deal with the
    > internet. It can happen without user intervention if desired.


    WRONG! And that's why people had such a big problem with the
    registration of Windows 2000. Imagine the following scenario:
    You've been dispatched to Tokyo and your CD-ROM drive decides
    to travel farther south than you. No problem, right? Go down
    to the Shinjuku district to find a cheap replacement. Only
    problem now is that your system won't boot.
    What are you going to do when Windows won't boot since you've
    changed some hardware? Long-distance telephone call to Redmond
    from Tokyo? Any idea what that costs? Sitting on hold for 30-
    45 minutes?
    Perhaps you know about some magical mechanism whereby you can
    annonymously connect and have reregistration performed auto-
    magically but all my sources indicate otherwise.
    Elucidate, if you would be so kind.
    Sudsy, Jul 5, 2003
    #16
  17. Roedy Green

    Roedy Green Guest

    On Fri, 04 Jul 2003 23:22:47 -0400, Sudsy <>
    wrote or quoted :

    >Perhaps you know about some magical mechanism whereby you can
    >annonymously connect and have reregistration performed auto-
    >magically but all my sources indicate otherwise.
    >Elucidate, if you would be so kind.


    A grace period would handle much of that.

    A long distance call could give you a key to get it going again.

    My scheme allows you to run any software any time; it just records
    usage for billing. See http://mindprod.com/projsoftwarerental.html

    You can stay disconnected, but then you don't get any updates. As
    soon as you reconnect for any update, Your billing info is captured.


    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 5, 2003
    #17
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SJ

    MAC Address/Physical Address?

    SJ, Jan 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    520
  2. Jon A. Cruz

    Re: how to detect MAC address

    Jon A. Cruz, Jun 27, 2003, in forum: Java
    Replies:
    8
    Views:
    9,442
    Sudsy
    Jun 30, 2003
  3. Rene
    Replies:
    0
    Views:
    8,167
  4. Roedy Green

    Re: how to detect MAC address

    Roedy Green, Jul 1, 2003, in forum: Java
    Replies:
    0
    Views:
    854
    Roedy Green
    Jul 1, 2003
  5. Filipe

    Detect Mac OS X Version

    Filipe, Jan 10, 2008, in forum: Ruby
    Replies:
    4
    Views:
    160
    Roger Pack
    Jan 10, 2008
Loading...

Share This Page