Digital Signature Algorithm (DSA)是Schnorr和ElGamal簽名算法的變種,被美國NIST作為DSS(DigitalSignature Standard)。算法中應用了下述參數:
p:L bits長的素數。L是64的倍數,范圍是512到1024;
q:p - 1的160bits的素因子;
g:g = h^((p-1)/q) mod p,h滿足h < p - 1, h^((p-1)/q) mod p > 1;
x:x < q,x為私鑰 ;
y:y = g^x mod p ,( p, q, g, y )為公鑰;
H( x ):One-Way Hash函數。DSS中選用SHA( Secure Hash Algorithm )。
p, q, g可由一組用戶共享,但在實際應用中,使用公共模數可能會帶來一定的威脅。簽名及驗證協議如下:
1. P產生隨機數k,k < q;
2. P計算 r = ( g^k mod p ) mod q
s = ( k^(-1) (H(m) + xr)) mod q
簽名結果是( m, r, s )。
3. 驗證時計算 w = s^(-1)mod q
u1 = ( H( m ) * w ) mod q
u2 = ( r * w ) mod q
v = (( g^u1 * y^u2 ) mod p ) mod q
若v = r,則認為簽名有效。
DSA是基于整數有限域離散對數難題的,其安全性與RSA相比差不多。DSA的一個重要特點是兩個素數公開,這樣,當使用別人的p和q時,即使不知道私鑰,你也能確認它們是否是隨機產生的,還是作了手腳。RSA算法卻作不到。
標簽:
Algorithm
Signature
Digital
Schnorr
上傳時間:
2014-01-01
上傳用戶:qq521
密碼學界牛人Victor Shoup用C++編寫數論類庫。
NTL is a high-performance, portable C++ library providing data structures and algorithms for arbitrary length integers for vectors, matrices, and polynomials over the integers and over finite fields and for arbitrary precision floating point arithmetic.
NTL provides high quality implementations of state-of-the-art algorithms for:
* arbitrary length integer arithmetic and arbitrary precision floating point arithmetic
* polynomial arithmetic over the integers and finite fields including basic arithmetic, polynomial factorization, irreducibility testing, computation of minimal polynomials, traces, norms, and more
* lattice basis reduction, including very robust and fast implementations of Schnorr-Euchner, block Korkin-Zolotarev reduction, and the new Schnorr-Horner pruning heuristic for block Korkin-Zolotarev
* basic linear algebra over the integers, finite fields, and arbitrary precision floating point numbers.
標簽:
high-performance
providing
portable
library
上傳時間:
2014-01-04
上傳用戶:exxxds