Block cipher implementation in python