File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programming Diversions and the fly likes Hacking the identicons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Hacking the identicons" Watch "Hacking the identicons" New topic
Author

Hacking the identicons

Aakash Goel
Ranch Hand

Joined: May 26, 2008
Posts: 198
This page says that identicons can be used as visual fingerprints.

From my understanding, it is possible to generate an identicon from an IP address, but an IP address cannot be uniquely identified from a given identicon.

But we can narrow down the list of possible IP addresses, correct?
I mean to say that based on the identicon we can discard some IP addresses or arrive at a range in which the IP addresses migh lie. Am I correct?


SCJP 5 95%
SCJP FAQ | SCJP Mock Tests | SCJP Tipline | Generics
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1013
    
    3
Aakash Goel wrote:This page says that identicons can be used as visual fingerprints.

From my understanding, it is possible to generate an identicon from an IP address, but an IP address cannot be uniquely identified from a given identicon.

But we can narrow down the list of possible IP addresses, correct?
I mean to say that based on the identicon we can discard some IP addresses or arrive at a range in which the IP addresses migh lie. Am I correct?



IF I UNDERSTAND CORRECTLY...
An IP address is 32 bits long. An MD5 digest is 128 bits. The chances are pretty darn good (guarenteed?) that every IP address will be encoded to a different digest. So even though it's essentially a one-way encoding, it is one-to-one.

...much like fingerprints. If I gave you TWO left thumb prints, you could tell me if they were from the same person. But if I showed you just one left thumb finger print, you couldn't tell me who it was from. ...unless you had a catalog/database of known left thumb prints.
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1013
    
    3
But...

Why are you asking? If this is for your own site, just implement an identicon algorithm that has the properties YOU want. How hard can it be?...
- Get the IP address or whatever bits of information from the HTTP Request.
- Digest it if you want/need to. MD5 generates 128 bits, but an IP address is only 32 bits to begin with.
- Use those bits to draw a picture/icon of some type.

The icon you generate certainly doesn't have to be one of the types that already exist. You could do a variation on an existing system. For instance the quilt identicons are all white plus just one additional color. There's no reason you couldn't generate quilt squares that have three or four colors. Heck, the squares don't even have to be squares.

I know... have the encoded/digested bits control some kind of virtual scene in 3D space and use a ray-tracing program like POV-Ray to generate the icon. That would be sweet!

Aakash Goel
Ranch Hand

Joined: May 26, 2008
Posts: 198
Ryan McGuire wrote:

I know... have the encoded/digested bits control some kind of virtual scene in 3D space and use a ray-tracing program like POV-Ray to generate the icon. That would be sweet!



Awesome thought!

No, it is not for any site. I was generally reading up on the topic... but I will definitely try out some funky implementation... maybe this idea of yours.
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1013
    
    3
Aakash Goel wrote:
Ryan McGuire wrote:

I know... have the encoded/digested bits control some kind of virtual scene in 3D space and use a ray-tracing program like POV-Ray to generate the icon. That would be sweet!



Awesome thought!

No, it is not for any site. I was generally reading up on the topic... but I will definitely try out some funky implementation... maybe this idea of yours.


How about this one. Give whatever icon you make a mouseOver event that plays a sound that is part of the encoded value. http://www.codeorgan.com/ takes the contents of a web page and generates a song out of it. You could do the same type of thing from the poster's IP addr or name or whatever. Maybe music... maybe you use just 5 bits to select one of 32 sound effects: a car screeching to a halt, a trumpet fan fare, a bird chirping, somone whistling "Oh, Canada".

Why stop at just the icon and sound? You could also add movement. Use a few bits of the encoded value to determine if the icon should move around in a circle, swing back and forth, fade in and out, flip over (like a playing card), etc.

Now that we've broken out of the "just an icon" box, I'm sure we could think of any number of fun and exciting things to add.

Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1013
    
    3
Aakash, any progress implementing anything?
Aakash Goel
Ranch Hand

Joined: May 26, 2008
Posts: 198
Ryan McGuire wrote:Aakash, any progress implementing anything?


Ryan, thanks for asking. No, did not work on it up till now. Wait till end of June and I'll let you know?
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1013
    
    3
Aakash Goel wrote:Ryan, thanks for asking. No, did not work on it up till now. Wait till end of June and I'll let you know?


Well? :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hacking the identicons