User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Compile raspberry serial number to sd card

Thu Oct 23, 2014 4:16 pm

Hi, good day how can I compile the raspberry pi serial number in to a SD Card so that the SD card cannot be cloned. Can i get a tutorial please thanks!
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

User avatar
RaTTuS
Posts: 10458
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Compile raspberry serial number to sd card

Thu Oct 23, 2014 4:21 pm

it's not trivial ,
if you have access to the physical hardware then all bets are off
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
DougieLawson
Posts: 36123
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Compile raspberry serial number to sd card

Thu Oct 23, 2014 4:23 pm

expandables wrote:Hi, good day how can I compile the raspberry pi serial number in to a SD Card so that the SD card cannot be cloned. Can i get a tutorial please thanks!
What are you trying to achieve? Because with three lines of bash script my serial number (from /proc/cpuinfo) can be any value I choose.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Compile raspberry serial number to sd card

Thu Oct 23, 2014 5:13 pm

I want a tutorial on how i can stop the cloning of an sd card using a software such as win32 disk imager. Basically I want to compile the raspberry pi number to an sd card. Can I get a full tutorial on how i can do that.
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

tbd.pi
Posts: 34
Joined: Sat Aug 11, 2012 11:21 am
Location: NJ,USA
Contact: Website

Re: Compile raspberry serial number to sd card

Thu Oct 23, 2014 5:32 pm

I can't help you, and I certainly don't want to hijack the thread, but I would like to understand the use case, why would you want to limit an SD card to a single Pi? The only thing I can imagine was if you were selling an application that used the Pi and didn't want the consumer to be able to just copy the SD card and cut you out of a sale.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5963
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Compile raspberry serial number to sd card

Thu Oct 23, 2014 5:43 pm

The only way to prevent someone from cloning your card is to break it.

W. H. Heydt
Posts: 10884
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Compile raspberry serial number to sd card

Thu Oct 23, 2014 8:56 pm

I agree that it sounds like an attempt at DRM. Perhaps the OP needs to remember that he doesn't own the OS unless he writes his own, and if he is using an existing OS that falls under a GPL license, trying to restrict distribution could remove his right to distribute.

User avatar
DougieLawson
Posts: 36123
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Compile raspberry serial number to sd card

Thu Oct 23, 2014 9:00 pm

expandables wrote:I want a tutorial on how i can stop the cloning of an sd card using a software such as win32 disk imager. Basically I want to compile the raspberry pi number to an sd card. Can I get a full tutorial on how i can do that.
The only way you can achieve anything like that is with superglue, sugru, a hot glue gun or epoxy. To physically weld the SDCard to the Pi. Even that wouldn't be foolproof.

The other way is to lock your Raspberry Pi in a cage that only allows a power cable & ethernet cable out. Even that isn't foolproof if I have a set of side cutters in my pocket.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 1:08 pm

Thanks for all the suggestions but i just wanted to know how i can compile a serial number to an sd card.
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

tbd.pi
Posts: 34
Joined: Sat Aug 11, 2012 11:21 am
Location: NJ,USA
Contact: Website

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 1:17 pm

I think the general consensus appears to be that you can't really protect the SD card or the contents of it. Tools that copy cards don't generally care or interact with the contents of them, they'll just take a copy of the contents.

Maybe if you shared a little more about what you're trying to achieve, then you might get some answers or suggestions that guide you a little more.

User avatar
DougieLawson
Posts: 36123
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 1:19 pm

expandables wrote:Thanks for all the suggestions but i just wanted to know how i can compile a serial number to an sd card.
Simple answer: you can't.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 1:55 pm

The Pi probably isn't the ideal machine to build a commercial project from because it is so easily copied.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

klricks
Posts: 6589
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 1:56 pm

tbd.pi wrote:I think the general consensus appears to be that you can't really protect the SD card or the contents of it. Tools that copy cards don't generally care or interact with the contents of them, they'll just take a copy of the contents. .....
....
...And then any unique content on the SD card such as a serial number could be easily modified...


Protection schemes like the OP wants only give frustration to the legitimate user but provide little or no bother to the pirate.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2093
Joined: Thu Jul 11, 2013 2:37 pm

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 1:57 pm

pluggy wrote:The Pi probably isn't the ideal machine to build a commercial project from because it is so easily copied.
Elaborate please.

Are you saying the hardware is so easily copied, the software is so easily copied, both, or something else?
Rockets are loud.
https://astro-pi.org

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 2:01 pm

expandables wrote:Thanks for all the suggestions but i just wanted to know how i can compile a serial number to an sd card.
Not sure what you mean by "compile" in this context but

vcgencmd otp_data > uniquedata.txt

will create a file containing the Pi's unique data (serials, revision etc) if that's what you mean.

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 2:13 pm

I'm just trying to make it difficult for some one to copy the sd card. I understand the flaws i just want to stop an average person from copying it. SO is there any preventive measures i can take to stop an average person from copying the sd card?
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

drgeoff
Posts: 9805
Joined: Wed Jan 25, 2012 6:39 pm

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 2:31 pm

As you acknowledged earlier tools such as Win32DiskImager will readily clone a card. And will do it irrespective of any protection measure such as a serial number "complied" (whatever you think that means) into the card.

Locking a card to a specific RPi is a different question which has been asked before. The answers to that given above have not changed since then.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5963
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 2:32 pm

I think you're asking the wrong question.

You can't prevent people from copying cards, but you can make it difficult for them to do anything useful with them. You can use the serial number as the encryption key, for example. It would be easy to break, but it would prevent the average person from doing so.

I'm not going to get into details though.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 2:33 pm

jdb wrote:
pluggy wrote:The Pi probably isn't the ideal machine to build a commercial project from because it is so easily copied.
Elaborate please.

Are you saying the hardware is so easily copied, the software is so easily copied, both, or something else?
The software on the SD card (which is everything on a Pi) is easily copied. Due to Broadcom's grip on their SOC's, its very difficult to copy the Pi. Hence the complete lack of Raspberry Pi Clones after 2 and a half years of production.

If you have put a lot of work into making a Pi do something which you then sell as a product, there's very little stopping a competitor buying a Pi and making a copy of your work to sell himself. You want something with real firmware you can hide behind.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2093
Joined: Thu Jul 11, 2013 2:37 pm

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 2:56 pm

pluggy wrote:
jdb wrote:
pluggy wrote:The Pi probably isn't the ideal machine to build a commercial project from because it is so easily copied.
Elaborate please.

Are you saying the hardware is so easily copied, the software is so easily copied, both, or something else?
The software on the SD card (which is everything on a Pi) is easily copied. Due to Broadcom's grip on their SOC's, its very difficult to copy the Pi. Hence the complete lack of Raspberry Pi Clones after 2 and a half years of production.

If you have put a lot of work into making a Pi do something which you then sell as a product, there's very little stopping a competitor buying a Pi and making a copy of your work to sell himself. You want something with real firmware you can hide behind.
There are features within the chip that are precisely designed to cater to the use case you (and probably the OP) describe.

These are not used or enabled on the Pi platform.

Also be aware that if these methods *were* enabled, it would constitute "TIVOisation" under GPLv3 (which several software components shipped in Debian are licenced under) and as such expressly forbidden. This would restrict you to either a) not using GPLv3 binaries or b) writing the necessary components yourself.
Rockets are loud.
https://astro-pi.org

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 3:00 pm

Ok I guess i will just super glue the sd card in place. And hopefully if they try to take it out it breaks.
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

tbd.pi
Posts: 34
Joined: Sat Aug 11, 2012 11:21 am
Location: NJ,USA
Contact: Website

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 3:05 pm

Are you trying to protect a piece of software you've developed and are deploying on the pi? What's the use case? If you can require internet connection, then you could "dial home" to a licensing system. If no internet, you could also come up with a key generator of some sort for that requires you give them a code to activate the software. There's all sorts of options that will deter all but the most dedicated from copying. Which it appears is what you want to do.

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 3:13 pm

tbd.pi wrote:Are you trying to protect a piece of software you've developed and are deploying on the pi? What's the use case? If you can require internet connection, then you could "dial home" to a licensing system. If no internet, you could also come up with a key generator of some sort for that requires you give them a code to activate the software. There's all sorts of options that will deter all but the most dedicated from copying. Which it appears is what you want to do.
I want to do that but don't know how to that's why i was asking for a tutorial.
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

W. H. Heydt
Posts: 10884
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 3:29 pm

expandables wrote:Ok I guess i will just super glue the sd card in place. And hopefully if they try to take it out it breaks.
Actually...all that would do would be to make it inconvenient to copy the contents of the card, not impossible. (There are any number of file transfer protocols that would do the job, though it'd take a while.)

There is one set of pieces of software for the Pi that is restricted to a single unit. That's the various video decode licenses. But even there, you can still copy the card itself and either use the license(s) from the copy or use everything else on the card on a different Pi.

Personally, I wouldn't buy a Pi with an SD card permanently attached. SD cards do wear and the lifetime of a Pi will far exceed that of an SD card. On the whole, I think you're seeking a solution in search of a problem.

fruitoftheloom
Posts: 20716
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Compile raspberry serial number to sd card

Fri Oct 24, 2014 3:45 pm

Would not a Compute Module which uses a eMMC be a better proposition ?
Retired disgracefully.....

Return to “Beginners”