# Weak hashing function for memorable IPv6 addresses

IPv6 addresses in the form of 862A:7373:3386:BF1F:8D77:D3D2:220F:D7E0 are much harder to memorize or even transcribe than the 4 octets of IPv4.

There have been attempts to mitigate this, making IPv6 addresses somehow more memorable.

Is there an intentionally-weak hashing function which could be reversed to find that the phrase, say, "This is relatively benign and easy to spot if the phrase is bent so as to be not worth paying" would hash to a target IPv6 address? The hash would, of course, have many colliding inputs to choose from, and a potentially more memorable sentence, such as this example phrase, could be automatically offered.

I guess there are two parts: First a weak hash with good distribution in both directions. Second is an algorithm for selecting memorable phrases from among the many collisions (short, consisting of words from a specified language, perhaps even following a simplified grammar).

Although the hash function would need to be weak, I don't doubt that the effort is still significant - however, once the phrase is known, the computation of the hash to the target address is very quick.

EDIT

I found this related idea, Piphilology, for memorizing some digits of π:

How I wish a drink, alcoholic of course, after the heavy lectures involving quantum mechanics!

-
Does the function have to be defined over the whole address space, or can part of the address be selected for memorability? Does the transformation have to be doable by a human on the spot? Should redundancy be baked it to detect errors? – Gilles Jul 15 '12 at 18:29
The whole address space is preferred. It can require a computer to compute the hash. Redundancy would be neat! (But don't human language words have a fair amount of redundancy baked in already?) – Jason Kleban Jul 15 '12 at 18:32
Why not just use the domain name? IP addresses aren't for human consumption in the first place, and adding some computer-requiring memory aide doesn't sound so hot. – vonbrand Jan 28 '13 at 22:58
Because domain names require registration and a lookup. Domain names are fine, but we still use IPv4 addresses for certain things - why isn't there still that same use but for IPv6 addresses? – Jason Kleban Jan 29 '13 at 3:24
Are you aware of mnemonic major system? It maps consonants to digits and adds any vowels to form words. Although IPv6 would translate to some 40 words and it's hard to make them tell a story... – Karolis Juodelė Jul 22 '14 at 8:34

Take the IP address and a wordlist. Then turn the IP address into a list of words from the wordlist based on the digits of the address, base {length of wordlist}.

So, for instance, taking the diceware wordlist and your example, I get: 862A:7373:3386:BF1F:8D77:D3D2:220F:D7E0 -> mew hades cup viii 72 grit photo pick raid dey (or potentially the other way around, and/or padded on the other end).

Note this isn't lossy. Although you can relatively easily apply any lossy techniques to this. You may just wish to truncate the IP address, or only select every second bit or something before running it through this mapping.

-
Hey that's pretty neat! – Jason Kleban Sep 30 '15 at 20:37

It sounds like you have two use cases:

• Given a phrase, it will hash to a unique IPv6 address
• Given an IPv6 address, multiple phrases can hash to it (colliding inputs). Corollary: Given an IPv6 address, general multiple memorable phrases, which the user can choose from.

I believe you would have to roll your own solution here. IPv6 addresses are long enough that you probably have to use a function like SHA1 to be able to cover the address space.

To maximize the number of colliding phrases, you could try ignoring vowels, or the hundred most common words.

-
SHA1 would work for the first use case but not the second use case (you can't invert SHA1 in any reasonable amount of time; given a 128-bit value, you can't find an input that hashes to it in any reasonable amount of time). – D.W. Dec 18 '13 at 8:01