Position of password in a bruteforce list

52 Views Asked by At

The max/min lenght of the password is 8 characters lenght and the password for example is: cocoso12

The passwordlist is composed by: $26$ letters $10$ number so the lenght of the list will be $36^8$.

But what is the formula (some example will be awesome) to calculate the position in the list of the word if the list start with 0 so 00000000: cocoso12 ?

2

There are 2 best solutions below

3
On BEST ANSWER

Guide:

Convert your interested string in base $36$ and you will get your position.

For example:

$00a02010_{36}$ is at $ 10\cdot 36^5 + 2\cdot 36^3 + 1 \cdot 36 $-th position if you start counting with index $0$.

Reading on numeral system. It is like hexadecimal number system, but rather than $16$, you have $36$ characters.

1
On

The password is (essentially) an $8$ digit number in base $36$ (assuming $36$ possible alphanumeric "digits"). If the list is in lexicographic order with $00000000$ first - position $0$ - and $zzzzzzzz$ last - position $36^8 -1$ - , you just have to expand the password in that base to find its numerical position.

Edit: if you want numerals to follow letters in the alphabetical order, change the numerical values of the digits accordingly.

Here's a sample calculation if the only "digits" allowed are $a$, $b$, $0$ and $1$ in that order and the password is the three digits $b0a$. The digit order says $a,b,0,1$ correspond to values $0,1,2,3$ so that password is $$ b0a = 1 \times 4^2 + 2 \times 4 + 0 = 24. $$

The smallest password $aaa = 0$; the largest password $111 = 63$.

You can work out the long example by yourself. You will get a very big number.