Replaced hardcoded identification of password position with dynamic code

To ensure connection with every username's length.
Merge pull request #1 from MicheleSr/master

Replaced hardcoded identification of password position with dynamic code