zoukankan      html  css  js  c++  java
  • What is the difference between DSA and RSA?

    What is the difference between DSA and RSA?

    Referring, https://web.archive.org/web/20140212143556/http://courses.cs.tamu.edu:80/pooch/665_spring2008/Australian-sec-2006/less19.html

    RSA
    RSA encryption and decryption are commutative
    hence it may be used directly as a digital signature scheme
    given an RSA scheme {(e,R), (d,p,q)}
    to sign a message M, compute:
    S = M power d (mod R)
    to verify a signature, compute:
    M = S power e(mod R) = M power e.d(mod R) = M(mod R)

    RSA can be used both for encryption and digital signatures, simply by reversing the order in which the exponents are used: the secret exponent (d) to create the signature, the public exponent (e) for anyone to verify the signature. Everything else is identical.

    DSA (Digital Signature Algorithm)
    DSA is a variant on the ElGamal and Schnorr algorithms creates a 320 bit signature, but with 512-1024 bit security security again rests on difficulty of computing discrete logarithms has been quite widely accepted

    DSA Key Generation
    firstly shared global public key values (p,q,g) are chosen:
    choose a large prime p = 2 power L
    where L= 512 to 1024 bits and is a multiple of 64
    choose q, a 160 bit prime factor of p-1
    choose g = h power (p-1)/q
    for any h1
    then each user chooses a private key and computes their public key:
    choose x compute y = g power x(mod p)

    DSA key generation is related to, but somewhat more complex than El Gamal. Mostly because of the use of the secondary 160-bit modulus q used to help speed up calculations and reduce the size of the resulting signature.

    DSA Signature Creation and Verification

    to sign a message M
    generate random signature key k, k compute
    r = (g power k(mod p))(mod q)
    s = k-1.SHA(M)+ x.r (mod q)
    send signature (r,s) with message

    to verify a signature, compute:
    w = s-1(mod q)
    u1= (SHA(M).w)(mod q)
    u2= r.w(mod q)
    v = (g power u1.y power u2(mod p))(mod q)
    if v=r then the signature is verified

    Signature creation is again similar to ElGamal with the use of a per message temporary signature key k, but doing calc first mod p, then mod q to reduce the size of the result. Note that the use of the hash function SHA is explicit here. Verification also consists of comparing two computations, again being a bit more complex than, but related to El Gamal.
    Note that nearly all the calculations are mod q, and hence are much faster.
    But, In contrast to RSA, DSA can be used only for digital signatures

    DSA Security
    The presence of a subliminal channel exists in many schemes (any that need a random number to be chosen), not just DSA. It emphasises the need for "system security", not just a good algorithm. 

  • 相关阅读:
    [文字雲產生器] Tagxedo 把文字串成雲、變成畫,印在 T-Shirt、馬克杯、詩袋….
    python学习(六)
    根据URL地址获取域名
    python学习(五)
    Linux下查看Mysql数据库端口的方法
    python学习(四)
    python学习(三)
    python学习(二)
    Java String删除字符串中间的某部分
    Spring的一个入门例子
  • 原文地址:https://www.cnblogs.com/chucklu/p/14001370.html
Copyright © 2011-2022 走看看