0

I'm planning to run a business Charging Station. To register that charging station in my server I need the custom id (Device ID).

In my scenario. I have an img of my program. Anyone can download the img and put it on their raspberrypi. I want to create a custom id for every raspberry pi.

I'm planning to use serial and hardware from /proc/cpuinfo. But I don't have any idea on how to do base on my preferred id.

Do you have any Idea?

Preffered ID: IDHQ321001 IDAZ74190i IDHQ621AQW

Borz
  • 1
  • 1

2 Answers2

1

You should really generate your own ID instead of relying on an existing one. Then you can chose any format you like, guarantee uniqueness, make the ID cryptographically strong, etc. etc.

If you're under the impression that using hardware IDs from /proc/cpuinfo offer you some sort of copy protection, rest assured that this is not the case. In Linux, you can trivially fake any file using chroot command, LD_PRELOAD variable and some other means.

Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147
0

If you intend, as discussed in the comments, to use the 64-bit processor serial number "hashed" into a shorter string to use as your ID then my suggestion would be to look at one of the many base32 encoding schemes to generate a string from the serial number instead.

For example, RFC4648 encoding 0x01234567 and dropping the padding character gives you AERUKZY. You could also use base64url (also from RFC4648) and get ASNFZw but with base64 you will get some non-alphanumeric characters as well as a mix of upper- and lower-cases in the resulting string, from your given examples that does not seem to be acceptable.

Some further reading that might be of use:

Roger Jones
  • 1,484
  • 8
  • 14