关于「熵的账本:log2(N^L)、随机长短语与复杂短密码」,《口令熵与最小权限》给出的定量结论是什么?

结论:第二章计算熵:8 位全字符随机口令 52.44 比特,四个随机词 51.70 比特,五个随机词 64.62 比特,并说明人选短语不能按熵公式计算。

数据口径:书中的公司、账户与概率参数均为示意,全部计算由书中程序生成;本书不是个性化的经营、法律、财务或合规建议,审计流程与小工具不接触任何真实口令。 第六章用最小角色覆盖与找回关系图说明,示意公司期望每年失守 0.4972 个账户,只加固主邮箱就降到 0.1899。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 51.70, 52.44, 64.62

secretalphabetlengthbits
6 digits10619.93
8 lowercase26837.60
8 printable94852.44
12 printable941278.66
15 lowercase261570.51
16 lowercase261675.21
3 words7776338.77
4 words7776451.70
5 words7776564.62
6 words7776677.55
7 words7776790.47
bits per word 12.925; per printable character 6.555
words to beat 8 printable: 5
words to beat 12 printable: 7

核心公式

\[H = \log_2 (N^L) = L \log_2 N \text{ 比特。}\]
查看完整验算程序
# Chapter 2. p21: entropy log2(N^L) of randomly generated secrets.
# For a secret drawn uniformly from an alphabet of N symbols, L symbols
# long, the entropy is L * log2(N) bits. Alphabets: 10 digits, 26
# lowercase letters, 94 printable ASCII characters, and a 7776-word list
# (6^5 words, one word per five dice). These are exact for machine- or
# dice-generated secrets only; human choice is the subject of Ch. 3.
import math

ROWS = [
    ("6 digits", 10, 6),
    ("8 lowercase", 26, 8),
    ("8 printable", 94, 8),
    ("12 printable", 94, 12),
    ("15 lowercase", 26, 15),
    ("16 lowercase", 26, 16),
    ("3 words", 7776, 3),
    ("4 words", 7776, 4),
    ("5 words", 7776, 5),
    ("6 words", 7776, 6),
    ("7 words", 7776, 7),
]


def bits(n, length):
    return length * math.log2(n)


print("secret          alphabet  length  bits")
for name, n, length in ROWS:
    print("{:<15s} {:>8d}  {:>6d}  {:6.2f}".format(
        name, n, length, bits(n, length)))
per_word = math.log2(7776)
target = bits(94, 8)
need = math.ceil(target / per_word)
print("bits per word {:.3f}; per printable character {:.3f}".format(
    per_word, math.log2(94)))
print("words to beat 8 printable: {}".format(need))
print("words to beat 12 printable: {}".format(
    math.ceil(bits(94, 12) / per_word)))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《口令熵与撞库攻击、强制改密反安全悖论与一人公司账号最小权限母典》第 2 章「熵的账本:log2(N^L)、随机长短语与复杂短密码」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-218 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026218,
  author    = {Fan, Yafu},
  title     = {Password Entropy and Credential Stuffing, the Forced-Rotation Paradox and Least-Privilege Accounts for One-Person Firms},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论