encrypt.py: port table to support python 3
Merge pull request #208 from felixonmars/table-py3

encrypt.py: port table to support python 3 (recreated)