Lect 7 - Digital Signatures

CSEN 1001
Computer
and
Network
Security
Amr El Mougy
Alaa Gohar
Heba Anwar
**Slides are attributed to William Stallings
Lecture (7)
Digital Signatures
Digital Signatures
Have looked at message authentication
but does not address issues of lack of trust
Digital signatures provide the
ability to:
verify author, date & time of
signature
authenticate message contents
be verified by third parties to
resolve disputes
Hence include authentication
function with additional capabilities
Attacks on Digital Signatures
Known
message
attack
•C only
knows A’s
public key
Key-only
attack
•C is given
access to a
set of
messages
and their
signatures
•C chooses a list
of messages
before
attempting to
break A’s
signature
scheme,
independent of
A’s public key; C
then obtains
from A valid
signatures for
the chosen
messages
Generic chosen
message attack
Directed chosen
message attack
•Similar to the
generic attack,
except that the
list of messages
to be signed is
chosen after C
knows A’s public
key but before
any signatures
are seen
•C may
request
from A
signatures
of
messages
that
depend on
previously
obtained
messagesignature
pairs
Adaptive
chosen
message
attack
Forgeries
Universal
forgery
Total break
•C
determines
A’s private
key
• C finds an
efficient
signing
algorithm
that provides
an equivalent
way of
constructing
signatures on
arbitrary
messages
Selective
forgery
• C forges a
signature for
a particular
message
chosen by C
Existential
forgery
• C forges a
signature for
at least one
message; C
has no
control over
the message
Digital Signature Properties
Must depend on the message signed
Must use information unique to sender
to prevent both forgery and denial
Must be relatively easy to produce
Must be relatively easy to recognize & verify
Be computationally infeasible to forge
with new message for existing digital signature
with fraudulent digital signature for given message
Be practical save digital signature in storage
Direct Digital Signatures
Involve only sender & receiver
Assumed receiver has sender’s public-key
Digital signature made by sender signing entire
message or hash with private-key
Can encrypt using receivers public-key
Important that sign first then encrypt message &
signature
Security depends on sender’s private-key
Arbitrated Digital Signatures
Involves use of arbiter A
validates any signed message
then dated and sent to recipient
Requires suitable level of trust in arbiter
Can be implemented with either private or public-key
algorithms
Arbiter may or may not see message
(1) XA: M||E(Kxa , [IDX||H(M)])
(2) AY: E(Kay , [IDX||M||E(Kxa, [IDX||H(M)])||T])
(a) Conventional Encryption, Arbiter Sees Message
(1) XA: IDX||E(Kxy , M)||E(Kxa , [IDX||H(E(Kxy , M))])
(2) AY: E(Kay ,[IDX||E(Kxy , M)])||E(Kxa , [IDX||H(E(Kxy , M))||T])
(b) Conventional Encryption, Arbiter Does Not See Message
(1) XA: IDX||E(PRx , [IDX||E(PUy , E(PRx , M))])
(2) AY: E(PRa , [IDX||E(PUy , E(PRx , M))||T])
(c) Public-Key Encryption, Arbiter Does Not See Message
Digital Signature Standard (DSS)
US Govt approved signature scheme
Designed by NIST & NSA in early 90's
Published as FIPS-186 in 1991
Revised in 1993, 1996 & then 2000
Uses the SHA hash algorithm
DSS is the standard, DSA is the algorithm
FIPS 186-2 (2000) includes alternative RSA & elliptic
curve signature variants
FIPS 186-3 in 2009,and FIPS 186-4 in 2013 contain
new elliptic curves and higher RSA keys
Digital Signature Algorithm (DSA)
Smaller and faster than RSA
A digital signature scheme only
Security depends on difficulty of computing discrete logarithms
DSA Key Generation
Have shared global public key values (p,q,g):
choose q, an N-bit prime
choose a large prime 2L-1< p<2L
where L= 512 to 1024 bits and is a multiple of 64
and q is a prime factor of (p-1)
choose g = h(p-1)/q mod p
where h<p-1, g > 1
Users choose private & compute public key:
choose x<q
compute y = gx (mod p)
DSA Signature Creation
To sign a message M, the sender:
generates a random signature key k, k<q
nb. k must be random, be destroyed after use, and never
be reused
Then computes signature pair:
r = (gk mod p)mod q
s = [k-1(H(M)+ x.r)]mod q
Sends signature (r,s) with message M
DSA Signature Verification
Having received M & signature (r,s)
To verify a signature, recipient computes:
w =
u1=
u2=
v =
s-1(mod q)
(H(M’).w)(mod q)
(r’.w)(mod q)
(gu1.yu2(mod p)) (mod q)
If v=r then signature is verified
DSA Example
For a digital signature scheme based on DSS, assume
that q = 101, p = 7879, and h = 3. Use these parameters
to produce the digital signature for the message digest
H(M) = 22. Assume that the sender has chosen the
private key x = 75 and that the generated pseudorandom
integer k = 50.
DSA Example
 Step 1: key generation
𝑔 = ℎ(𝑝−1)/𝑞 𝑚𝑜𝑑 7879 = 37878/101 𝑚𝑜𝑑 7879 = 170
𝑦 = 𝑔 𝑥 𝑚𝑜𝑑 𝑝 = 17075 𝑚𝑜𝑑 7879 = 4567
 Step 2: Signature generation
𝑟 = 𝑔𝑘 𝑚𝑜𝑑 𝑝 𝑚𝑜𝑑 𝑞 = 17050 𝑚𝑜𝑑 7879 𝑚𝑜𝑑 101 = 95
𝑠 = 𝑘 −1 𝐻 𝑀 + 𝑥𝑟 𝑚𝑜𝑑 𝑞
𝑘 −1 𝑚𝑜𝑑 101 = 50−1 𝑚𝑜𝑑 101 = 99
Thus
𝑠 = 99 22 + 75 × 94 𝑚𝑜𝑑 101 = 97
The signature is (94, 97)
 Step 3: Verification
𝑤 = (𝑠 ′ )−1 𝑚𝑜𝑑 𝑞 = 97−1 𝑚𝑜𝑑 101 = 25
𝑢1 = 𝐻 𝑀′ 𝑤 𝑚𝑜𝑑 𝑞 = 22 × 25 𝑚𝑜𝑑 101 = 45
𝑢2 = 𝑟 ′ 𝑤 𝑚𝑜𝑑 𝑞 = 94 × 25 𝑚𝑜𝑑 101 = 27
𝑣 = (𝑔𝑢1 𝑦 𝑢2 )𝑚𝑜𝑑 𝑝 𝑚𝑜𝑑 𝑞 = (17045 × 456727 𝑚𝑜𝑑 7879]𝑚𝑜𝑑 101 = 94