Added header needed for getpass()

On some systems (Mac OSX Maverics)
this needs to be included for getpass
to be used
Fixed decoding

Coding and decoding is now handled differently
so that the result of decoding is actually correct now.