关于SRP协议: http://en.wikipedia.org/wiki/Secure_remote_password_protocol
我可以看到会话密钥(K)的生成是完全安全的,但在最后一步中,用户发送了K(M)的证明。如果网络不安全且midlle中的攻击者捕获了M,他就可以在没有K的情况下进行身份验证吗?
答案 0 :(得分:12)
众所周知的价值观(事先确定):
n A large prime number. All computations are performed modulo n.
g A primitive root modulo n (often called a generator).
用户密码建立为:
x = H(s, P)
v = g^x
H() One-way hash function
s A random string used as the user's salt
P The user's password
x A private key derived from the password and salt
v The host's password verifier
身份验证:
+---+------------------------+--------------+----------------------+
| | Alice | Public Wire | Bob |
+---+------------------------+--------------+----------------------+
| 1 | | C --> | (lookup s, v) |
| 2 | x = H(s, P) | <-- s | |
| 3 | A = g^a | A --> | |
| 4 | | <-- B, u | B = v + g^b |
| 5 | S = (B - g^x)^(a + ux) | | S = (A · v^u)^b |
| 6 | K = H(S) | | K = H(S) |
| 7 | M[1] = H(A, B, K) | M[1] --> | (verify M[1]) |
| 8 | (verify M[2]) | <-- M[2] | M[2] = H(A, M[1], K) |
+---+------------------------+--------------+----------------------+
u Random scrambling parameter, publicly revealed
a,b Ephemeral private keys, generated randomly and not publicly revealed
A,B Corresponding public keys
m,n The two quantities (strings) m and n concatenated
S Calculated exponential value
K Session key
如您所见,双方根据每个人可用的值分别计算K(=会话密钥)。
如果在步骤2中输入的Alice的密码P与她最初用于生成v的密码匹配,那么S的两个值将匹配。
答案 1 :(得分:0)
证明仅对某个K有效。
没有MITM:
Alice <-K-> Bob
Alice为K生成证明,Bob接受它
使用MITM:
Alice <-K1-> Eve <-K2-> Bob
Alice为K1制作了一个证明,但是当Eve将它呈现给Bob时,他不接受它,因为它不适合K2。