NX password scrambling and unscrambling algorithms in python 2.7