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. 

  • 相关阅读:
    15行CSS代码攻击会导致 iOS 系统重启或 Mac 冻结
    css3特效_CSS3弹跳Loading加载动画特效的实现
    Web前端设计排版小技巧
    webpack配置sass模块的加载
    前后端分离项目的跨域及保持Session会话
    css盒子模型_css全局设置border-box
    大厂前端推荐纯css实现气泡效果
    前端开发常用css动画代码
    VSCode调试网页JavaScript代码
    HTML连载77-3D播放器
  • 原文地址:https://www.cnblogs.com/chucklu/p/14001370.html
Copyright © 2011-2022 走看看