Python implementation of TKDF.