[...]
... Moreover if Password (P) is a stream of 1's then N will be a stream of 0's.
[...]
13 = 1101
^
1 = 1111
=========
0 = 0000
The above is incorrect, or I'm missing something. XORing a number with a stream of 1's would result in that number inverted, i.e.:
13 = 1101
^
1 = 1111
=========
2 = 0010