Added binary password write function.
The previous approach was hacky and broke often, as variables kept changing again and again.