You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

暴力破解字典中固定长度密码的位置计算方法及示例

Calculating Password Position in a 36-Character 8-Length Dictionary

Got it, let's break down exactly how to find where your password sits in that 8-character dictionary starting from 00000000. First, we need to lock down a few key details that make this calculation work.

Key Prerequisite: Character Set Order

The order of characters in your dictionary is make-or-break here—different orderings will give totally different positions. For this example, we'll use the standard alphanumeric order used in most brute-force dictionaries:

  • Digits first: 0 → index 0, 1 → index 1, ..., 9 → index 9
  • Lowercase letters next: a → index 10, b → index 11, ..., z → index 35

If your dictionary uses a different order (like letters first), just adjust the character-to-index mapping— the formula structure stays identical.

Core Formula

This problem is exactly like converting a base-36 number to a decimal number, with a small tweak if you want 1-based instead of 0-based positioning.

Let your 8-character password be [c1, c2, c3, c4, c5, c6, c7, c8] (where c1 is the leftmost character, c8 is the rightmost):

  1. Map each character ci to its index value vi using the mapping above
  2. Calculate the 0-based position (where 00000000 is position 0):
    position_0 = v1*(36^7) + v2*(36^6) + v3*(36^5) + v4*(36^4) + v5*(36^3) + v6*(36^2) + v7*(36^1) + v8*(36^0)
    
  3. If you want the 1-based position (where 00000000 is the 1st entry), just add 1:
    position_1 = position_0 + 1
    

Example Calculation for cocoso12

Let's walk through the example step by step:

Step 1: Map each character to its index

CharacterIndex (vi)Reason
c12a=10, b=11, so c=12
o24a=10, o is the 15th letter → 10+14=24
c12Same as above
o24Same as above
s28a=10, s is the 19th letter →10+18=28
o24Same as above
11Direct digit mapping
22Direct digit mapping

Step 2: Calculate each term

Compute each part of the formula:

  • v1*36^7 = 12 * 78364164096 = 940369969152
  • v2*36^6 =24 * 2176782336 = 52242776064
  • v3*36^5=12 * 60466176 = 725594112
  • v4*36^4=24 * 1679616 = 40310784
  • v5*36^3=28 * 46656 = 1306368
  • v6*36^2=24 * 1296 = 31104
  • v7*36^1=1 *36=36
  • v8*36^0=2*1=2

Step3: Sum all terms for position_0

Adding these up gives:
940369969152 + 52242776064 + 725594112 + 40310784 + 1306368 + 31104 +36 +2 = 993379987622

So:

  • 0-based position of cocoso12: 993379987622
  • 1-based position (if you count 00000000 as the first entry): 993379987623

Quick Notes

  • If your dictionary uses a different character order (e.g., letters before digits), update the index mapping accordingly. For example, if a=0, z=25, 0=26, then c would be index 2 instead of 12, which would change the final position.
  • The exponent values make sense because each leftmost character represents a larger block of passwords: the first character has 36^7 possible combinations for the remaining 7 positions, hence multiplying by 36^7.

内容的提问来源于stack exchange,提问作者Robert

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:38:23