<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Unique computer ID	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/unique-computer-id/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/unique-computer-id?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unique-computer-id</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Mon, 13 Jun 2022 09:38:20 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-514229</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Mon, 13 Jun 2022 09:38:20 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-514229</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/unique-computer-id#comment-514228&quot;&gt;Mitchell&lt;/a&gt;.

@Mitchell - in most cases the user wants a single string identifier for the computer, that uniquely identifies it with a distinct fingerprint that is different from any other computer. The network interface (MAC) addresses are reported by the operating system, and naturally change when you add or remove a network card or adapter. It is up to you to decide which of the MAC addresses should be included in the fingerprint: if you include all of them, it certainly makes your fingerprint unique, but might include addresses that change frequently (e.g. VPN, WiFi, or virtual interfaces). On the other hand, if you ignore too many interfaces, your SID might be easier to spoof. Different operating systems have different ways of handling network interface MAC addresses, and you should consider this as well. For example, Windows and Linux addresses are pretty stable, but MacOS constantly changes the addresses when you connect/disconnect a network interface. MacOS also changes the computer&#039;s hostname automatically, without any user approval, which is a PITA. In short, having a stable, unique SID that is less prone to spoofing requires some thought. If you need my assistance with this, please contact me privately (altmany at gmail).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/unique-computer-id#comment-514228">Mitchell</a>.</p>
<p>@Mitchell &#8211; in most cases the user wants a single string identifier for the computer, that uniquely identifies it with a distinct fingerprint that is different from any other computer. The network interface (MAC) addresses are reported by the operating system, and naturally change when you add or remove a network card or adapter. It is up to you to decide which of the MAC addresses should be included in the fingerprint: if you include all of them, it certainly makes your fingerprint unique, but might include addresses that change frequently (e.g. VPN, WiFi, or virtual interfaces). On the other hand, if you ignore too many interfaces, your SID might be easier to spoof. Different operating systems have different ways of handling network interface MAC addresses, and you should consider this as well. For example, Windows and Linux addresses are pretty stable, but MacOS constantly changes the addresses when you connect/disconnect a network interface. MacOS also changes the computer&#8217;s hostname automatically, without any user approval, which is a PITA. In short, having a stable, unique SID that is less prone to spoofing requires some thought. If you need my assistance with this, please contact me privately (altmany at gmail).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mitchell		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-514228</link>

		<dc:creator><![CDATA[Mitchell]]></dc:creator>
		<pubDate>Mon, 13 Jun 2022 00:58:39 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-514228</guid>

					<description><![CDATA[Great post! I&#039;m not very familiar with the network interfaces being referenced here, but it seems like the java-based cross-platform method concatenates all network interfaces. Does that mean that the SID returned by this method will change if a network interface is added or removed? Is it even possible to add or remove this type of network interface? Thanks!]]></description>
			<content:encoded><![CDATA[<p>Great post! I&#8217;m not very familiar with the network interfaces being referenced here, but it seems like the java-based cross-platform method concatenates all network interfaces. Does that mean that the SID returned by this method will change if a network interface is added or removed? Is it even possible to add or remove this type of network interface? Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Xiangrui Li		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-405763</link>

		<dc:creator><![CDATA[Xiangrui Li]]></dc:creator>
		<pubDate>Mon, 01 May 2017 20:06:18 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-405763</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/unique-computer-id#comment-62004&quot;&gt;Jayveer&lt;/a&gt;.

Here is my practice for regexp. For all OS, always take the first mac_add pattern in the string output.
&lt;pre lang=&quot;matlab&quot;&gt;
if ispc
    [~, a] = system(&#039;getmac&#039;);
    mac_add = regexp(a, &#039;([0-9A-F]{2}-){5}[0-9A-F]{2}&#039;, &#039;match&#039;, &#039;once&#039;);
elseif isunix % OSX and Linux
    [~, a] = system(&#039;ifconfig&#039;);
    mac_add = regexp(a, &#039;([0-9a-f]{2}:){5}[0-9a-f]{2}&#039;, &#039;match&#039;, &#039;once&#039;);
else
    mac_add = [];
end
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/unique-computer-id#comment-62004">Jayveer</a>.</p>
<p>Here is my practice for regexp. For all OS, always take the first mac_add pattern in the string output.</p>
<pre lang="matlab">
if ispc
    [~, a] = system('getmac');
    mac_add = regexp(a, '([0-9A-F]{2}-){5}[0-9A-F]{2}', 'match', 'once');
elseif isunix % OSX and Linux
    [~, a] = system('ifconfig');
    mac_add = regexp(a, '([0-9a-f]{2}:){5}[0-9a-f]{2}', 'match', 'once');
else
    mac_add = [];
end
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jeff E Mandel MD MS		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-392076</link>

		<dc:creator><![CDATA[Jeff E Mandel MD MS]]></dc:creator>
		<pubDate>Mon, 31 Oct 2016 13:41:06 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-392076</guid>

					<description><![CDATA[Newer Macs have a hardware UUID. Note that Apple won&#039;t allow a program that uses this in the App Store, but this probably won&#039;t affect too many people writing deployed applications. Here is a little routine that accesses the system profile using the system_profiler command.

&lt;pre lang=&quot;matlab&quot;&gt;
function profile = getMacProfile
% Retrieves all of the information from the OSX system profile and returns
% it in a structure, replacing spaces with underscores in the names and
% removing the attributes in parentheses.

[~,out]=system(&#039;system_profiler SPHardwareDataType&#039;);
theLines = splitlines(out);
for i = 1:length(theLines)
    if ~isempty(theLines{i})
        try
            c=strsplit(theLines{i},&#039;: &#039;);
            if length(c) == 2
                d=strip(c{1});
                e=regexprep(d,&#039; \(.*\)&#039;,&#039;&#039;);
                tag =strrep(e, &#039; &#039;,&#039;_&#039;);
                profile.(tag) = c{2};
            end
        catch
            % In case Apple comes up with a new entry
            disp(theLines{i});
        end
    end
end
&lt;/pre&gt;

The UDID (unique device ID) is returned in profile.Hardware_UUID. This is probably more reliable than the MAC address of EN0.]]></description>
			<content:encoded><![CDATA[<p>Newer Macs have a hardware UUID. Note that Apple won&#8217;t allow a program that uses this in the App Store, but this probably won&#8217;t affect too many people writing deployed applications. Here is a little routine that accesses the system profile using the system_profiler command.</p>
<pre lang="matlab">
function profile = getMacProfile
% Retrieves all of the information from the OSX system profile and returns
% it in a structure, replacing spaces with underscores in the names and
% removing the attributes in parentheses.

[~,out]=system('system_profiler SPHardwareDataType');
theLines = splitlines(out);
for i = 1:length(theLines)
    if ~isempty(theLines{i})
        try
            c=strsplit(theLines{i},': ');
            if length(c) == 2
                d=strip(c{1});
                e=regexprep(d,' \(.*\)','');
                tag =strrep(e, ' ','_');
                profile.(tag) = c{2};
            end
        catch
            % In case Apple comes up with a new entry
            disp(theLines{i});
        end
    end
end
</pre>
<p>The UDID (unique device ID) is returned in profile.Hardware_UUID. This is probably more reliable than the MAC address of EN0.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-315055</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 20 Feb 2014 17:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-315055</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/unique-computer-id#comment-315054&quot;&gt;thomas&lt;/a&gt;.

Next time don&#039;t post on a public blog something that you don&#039;t want to appear publicly!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/unique-computer-id#comment-315054">thomas</a>.</p>
<p>Next time don&#8217;t post on a public blog something that you don&#8217;t want to appear publicly!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: thomas		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-315054</link>

		<dc:creator><![CDATA[thomas]]></dc:creator>
		<pubDate>Thu, 20 Feb 2014 17:09:44 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-315054</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/unique-computer-id#comment-315035&quot;&gt;thomas&lt;/a&gt;.

oh, i see.. the new method indeed gives .00000000000000E0.50E54950537A :)

thank you for your clarification. could you please delete my mac addresses, they were not intended to go public :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/unique-computer-id#comment-315035">thomas</a>.</p>
<p>oh, i see.. the new method indeed gives .00000000000000E0.50E54950537A 🙂</p>
<p>thank you for your clarification. could you please delete my mac addresses, they were not intended to go public 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-315048</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 20 Feb 2014 16:56:43 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-315048</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/unique-computer-id#comment-315044&quot;&gt;thomas&lt;/a&gt;.

@Thomas - it&#039;s simply a different representation of the data. Here&#039;s an implementation that should return more legible results:

&lt;pre lang=&#039;matlab&#039;&gt;
ni = java.net.NetworkInterface.getNetworkInterfaces;
macStrs = {};
while ni.hasMoreElements
    macAddr = ni.nextElement.getHardwareAddress;
    if ~isempty(macAddr)
        macAddrStr = [&#039;.&#039; sprintf(&#039;%02X&#039;,mod(int16(macAddr),256))];
        macStrs{end+1} = macAddrStr; %#ok
    end
end
macStrs = sort(unique(macStrs));
sid = [macStrs{:}];
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/unique-computer-id#comment-315044">thomas</a>.</p>
<p>@Thomas &#8211; it&#8217;s simply a different representation of the data. Here&#8217;s an implementation that should return more legible results:</p>
<pre lang='matlab'>
ni = java.net.NetworkInterface.getNetworkInterfaces;
macStrs = {};
while ni.hasMoreElements
    macAddr = ni.nextElement.getHardwareAddress;
    if ~isempty(macAddr)
        macAddrStr = ['.' sprintf('%02X',mod(int16(macAddr),256))];
        macStrs{end+1} = macAddrStr; %#ok
    end
end
macStrs = sort(unique(macStrs));
sid = [macStrs{:}];
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: thomas		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-315044</link>

		<dc:creator><![CDATA[thomas]]></dc:creator>
		<pubDate>Thu, 20 Feb 2014 16:40:03 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-315044</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/unique-computer-id#comment-315035&quot;&gt;thomas&lt;/a&gt;.

Yes, they are different, this is why i am confused a bit. The SID method gives .D6CDDF05903C.8888888600000000.8888888600000000.8888888600000000
IPconfig says: 
50-E5-49-50-53-7A (this is the ethernet adapter)
00-00-00-00-00-00-00-E0 
00-00-00-00-00-00-00-E0 
00-00-00-00-00-00-00-E0]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/unique-computer-id#comment-315035">thomas</a>.</p>
<p>Yes, they are different, this is why i am confused a bit. The SID method gives .D6CDDF05903C.8888888600000000.8888888600000000.8888888600000000<br />
IPconfig says:<br />
50-E5-49-50-53-7A (this is the ethernet adapter)<br />
00-00-00-00-00-00-00-E0<br />
00-00-00-00-00-00-00-E0<br />
00-00-00-00-00-00-00-E0</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-315042</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 20 Feb 2014 16:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-315042</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/unique-computer-id#comment-315041&quot;&gt;thomas&lt;/a&gt;.

@Thomas - in this case you have 4 separate MAC addresses, from 4 separate network devices. Run the following in your Matlab command prompt to see the list (look at the &quot;Physical Address&quot; rows):
&lt;pre lang=&#039;matlab&#039;&gt;system(&#039;ipconfig /all&#039;)&lt;/pre&gt;

This again is only unique if the user does not fool around with the MACs...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/unique-computer-id#comment-315041">thomas</a>.</p>
<p>@Thomas &#8211; in this case you have 4 separate MAC addresses, from 4 separate network devices. Run the following in your Matlab command prompt to see the list (look at the &#8220;Physical Address&#8221; rows):</p>
<pre lang='matlab'>system('ipconfig /all')</pre>
<p>This again is only unique if the user does not fool around with the MACs&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: thomas		</title>
		<link>https://undocumentedmatlab.com/articles/unique-computer-id#comment-315041</link>

		<dc:creator><![CDATA[thomas]]></dc:creator>
		<pubDate>Thu, 20 Feb 2014 16:26:30 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2353#comment-315041</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/unique-computer-id#comment-315040&quot;&gt;Yair Altman&lt;/a&gt;.

@Yair - sorry, I meant not SID but that second method, where sid = .89ECC872C85C.8AFE928FEDB4.8262278A1CCA.899919B50FC9

Is it the MAC address? Because MAC address has 12 digits. My SID (this 48 digits long) is different from my MAC. Thanks.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/unique-computer-id#comment-315040">Yair Altman</a>.</p>
<p>@Yair &#8211; sorry, I meant not SID but that second method, where sid = .89ECC872C85C.8AFE928FEDB4.8262278A1CCA.899919B50FC9</p>
<p>Is it the MAC address? Because MAC address has 12 digits. My SID (this 48 digits long) is different from my MAC. Thanks.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
