I think this paper may help http://www.cs.ucdavis.edu/~rogaway/papers/p2f-abstract.html Adam