It looks like a magnetic encoder. Check the black ring to see if it is truly a magnet. The ring is magnetized so that it has many North and South poles side by side. The magnet triggers the hall effect sensor as it rotates. I am not sure what the resolution would be for yours. On the 4 wire side I would hazard to guess that the Red would be +5 volts, the black is ground. The quadrature output would be the white and blue. The motor connections of course would be the other two wires.