For an entity with multiple values, you need to concatenate them with "###UNLIKELY_DELIMITER###" as the delimiter: i.e., "192.168.0.30###UNLIKELY_DELIMITER###255.255.255.255".
Also, I forgot to mention one more step. Because Base64 generates characters that are not URI safe, "+" and "/" must be translated to "-" and "_" respectively: i.e., sed 'y/+\//-_/'.
Here's the revised version of the steps:
- Create a source input string by concatenating the elements using the ###UNLIKELY_DELIMITER### delimiter.
- Create the MD5 digest from the source input (yields 128 bits of binary data)
- Encode it using base64 (yields 24 characters)
- Trim the last two "==" (22 characters)
- Transliterate "+" and "/" to "-" and "_" respectively.
For example,
echo -n "192.168.0.30###UNLIKELY_DELIMITER###255.255.255.255" | openssl dgst -md5 -binary | base64 | cut -c-22 | sed 'y/+\//-_/'
2S_b6WCJRsVKz9xgrtxYPA
Note that the order of elements matters (e.g., 192.168.0.30...255.255.255.255 vs. 255.255.255.255...192.168.0.30) and depends on what entity you are dealing with. You need to try out (although the complexity of a brute-force try-and-error is O(2^N), thankfully, there is not so many combinations).
Cheers.