Encrypting MAC address to a 4digit number

Apr 4, 2014 at 9:25am
Hi,

I want to encrypt Mac address to 4 digit number which can be decrypted to original MAC address.

Waiting for valuable response
Apr 4, 2014 at 2:31pm
Encryption and compression are two different things. It sounds to me like you want to compress the number...

Which leads to the second point: Compression works by exploiting common repetition and patterns -- which you are unlikely to find in any given MAC address.

Your question is vague as well -- perhaps if you explain what you are trying to accomplish with this we might be able to suggest a better course of action.

Hope this helps.
Apr 4, 2014 at 2:45pm
As Duoas said, this doesn't make any sense.

You could create a mapping of 4 digit numbers to MAC addresses.
Apr 4, 2014 at 2:49pm
...which only works if you throw out large sections of valid MAC addresses. If there is a subset of addresses you wish to handle that can be indexed by a four-digit number then that would work.

You must remember that part of the data you are "compressing" or removing from the sample is actually just moved to the executable that does the (de)compression.
Apr 4, 2014 at 2:59pm
Good point. Even if OP only cares about one manufacturer, that still misses ~16 million addresses.
Apr 4, 2014 at 3:12pm
As other have said, this won't work. A MAC address is 48 bits. A 4 digit number requires requires 14 bits. You can't encrypt 48 bits into 14 bits without losing information. Nor can you compress 48 bits in 14 bits without losing information.
Apr 4, 2014 at 3:34pm
48 bits can be represented by 12 hex digits, since each hex digit can represent 4 bits apiece.
48 bits of data / 4 bits per hex digit = 12 hex digits to represent data
If you want to represent 48 bits with 4 digits, then you'll have to use a system of digits (let's just say... quux) that can represent 12 bits apiece.
48 bits of data / 12 bits per quux digit = 4 quux digits to represent data
This means you'll have to invent a number system with 4096 unique digits to faithfully represent 48 bits worth of information in 4 digits.
Apr 4, 2014 at 6:59pm
48 bits can be represented by 12 hex digits, since each hex digit can represent 4 bits apiece.


12 hex digits also require 4 bits per digit, which means 12 hex digits require 48 bits of storage.

If you want to represent 48 bits accurately, you need 48 bits.
Apr 4, 2014 at 7:36pm
What about 4 UTF-16 characters? ;)
Apr 4, 2014 at 8:07pm
LOL

BlakeK +1

Though the characters won't technically only have numbers.
Topic archived. No new replies allowed.