How do I encrypt a 12 character network adapter mac address so i can get in result with a 20 to 25 cipher text length?


A MAC address is actually 48 bits long, which can be displayed as 12 base-16 characters (4-bit hexidecimal).

If you encrypt the MAC address with a 64-bit block cipher such as Blowfish or DES, the resultant 64-bit value will be 16 base-16 characters.

If you encrypt the MAC address with a 128-bit block cipher such as AES or Twofish, it will be 32 base-16 characters, which exceeds your limit. However you can encode this value to base-64 (6-bit), and it will take 22 characters, less any padding which can be eliminated in implementation, since you have a known decode length. This length fits your requirement, if you are able to accept the encoding for whatever you are using this for.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.