关于「强制改密悖论:可预测的变体与被高估的攻击窗口」,《口令熵与最小权限》给出的定量结论是什么?
结论:第一章说明,对只需要一天访问的攻击者,每 90 天强制改密后其成功概率仍有 0.991,并依据原文把蓝图里的「已不建议」修正为修订第 4 版的「不得」,同时并陈自述行为研究的反方证据。
数据口径:书中的公司、账户与概率参数均为示意,全部计算由书中程序生成;本书不是个性化的经营、法律、财务或合规建议,审计流程与小工具不接触任何真实口令。 第六章用最小角色覆盖与找回关系图说明,示意公司期望每年失守 0.4972 个账户,只加固主邮箱就降到 0.1899。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.991, 90
| P(attacker keeps access for D days), compromise at random time | ||||
| online q=0.17 | ||||
| rotate every | D=1 | D=7 | D=30 | D=90 |
| never | 1.000 | 1.000 | 1.000 | 1.000 |
| 180 days | 0.995 | 0.968 | 0.862 | 0.585 |
| 90 days | 0.991 | 0.935 | 0.723 | 0.170 |
| 30 days | 0.972 | 0.806 | 0.170 | 0.005 |
| offline q=0.41 | ||||
| rotate every | D=1 | D=7 | D=30 | D=90 |
| never | 1.000 | 1.000 | 1.000 | 1.000 |
| 180 days | 0.997 | 0.977 | 0.902 | 0.705 |
| 90 days | 0.993 | 0.954 | 0.803 | 0.410 |
| 30 days | 0.980 | 0.862 | 0.410 | 0.069 |
| with persistence s=0.5 (forwarding rule survives a change) | ||||
| 90 days | 0.995 | 0.968 | 0.862 | 0.585 |
| 30 days | 0.986 | 0.903 | 0.585 | 0.502 |
核心公式
\[P = \sum_{k \ge 0} (1-q)\,q^k \, \Pr(U \ge D - kT).\]
查看完整验算程序
# Chapter 1. p11: does forced rotation shorten a stolen password's life?
# Model: the attacker obtains a password at a random moment; the time U
# to the next forced change is uniform on [0, T). After each change the
# user picks, with probability q, a variant derivable from the old one,
# so the attacker gets back in. The attacker needs D days of access.
# q = 0.17 is the online result (under 5 guesses) and q = 0.41 the
# offline result of Zhang, Monrose and Reiter (2010), from a dataset of
# over 7700 accounts (sourced); the persistence probability s is
# illustrative: a forwarding rule or app token planted after entry that
# survives the password change.
# Exact: P = s + (1 - s) * sum_k (1 - q) q^k P(U >= D - kT).
import math
Q_ONLINE = 0.17 # Zhang et al. 2010, under 5 online guesses
Q_OFFLINE = 0.41 # Zhang et al. 2010, offline, under 3 s per account
def p_reach(days, period, q, persist=0.0, kmax=400):
"""Probability that the attacker holds access for `days` days."""
if period is None:
return 1.0
terms = []
for k in range(kmax):
need = days - k * period # U must be at least this
frac = min(1.0, max(0.0, 1.0 - need / period))
terms.append((1.0 - q) * q ** k * frac)
return persist + (1.0 - persist) * math.fsum(terms)
DAYS = (1, 7, 30, 90)
print("P(attacker keeps access for D days), compromise at random time")
for q, tag in ((Q_ONLINE, "online q=0.17"), (Q_OFFLINE, "offline q=0.41")):
print(tag)
print(" rotate every " + "".join("D={:<5d}".format(d) for d in DAYS))
for per in (None, 180, 90, 30):
lab = "never" if per is None else "{} days".format(per)
row = "".join("{:<7.3f}".format(p_reach(d, per, q)) for d in DAYS)
print(" {:<14s}{}".format(lab, row))
print("with persistence s=0.5 (forwarding rule survives a change)")
for per in (90, 30):
row = "".join("{:<7.3f}".format(p_reach(d, per, Q_ONLINE, 0.5))
for d in DAYS)
print(" {:<14s}{}".format("{} days".format(per), row))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《口令熵与撞库攻击、强制改密反安全悖论与一人公司账号最小权限母典》第 1 章「强制改密悖论:可预测的变体与被高估的攻击窗口」(版本 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}
}