Signature Schemes
CR Chester Rebeiro IIT Madras
STINSON : chapter 7
Signature Schemes Chester Rebeiro IIT Madras CR STINSON : chapter - - PowerPoint PPT Presentation
Signature Schemes Chester Rebeiro IIT Madras CR STINSON : chapter 7 Recall : MACs y = h K (x) Alice Bob h K = K Attack at Dawn!! Message Digest h K K unsecure channel Message Message Attack at Dawn!! MACs allow Bob to be
STINSON : chapter 7
Alice Bob Message “Attack at Dawn!!” Message Digest
unsecure channel
K K
Message “Attack at Dawn!!”
2
MACs allow Bob to be certain that
MAC cannot
Digital Signatures solve both these problems
3
TA Bob’s Certificate{ Bob’s public key in plaintext Signature of the certifying authority
} Important application of digital signatures
To communicate with Bob, Alice gets his public key from a trusted authority (TA) A trusted authority could be a Government agency, Verisign, etc. A signature from the TA, ensures that the public key is authentic.
4
Alice (x, y) sigK
Alice’s Private Key
y = digital signature Everyone Else ver Alice’s TRUE / FALSE
Message x = “Attack at Dawn!!”
5
Signing Function y = siga(x) Input : Message (x) and Alice’s private key Output: Digital Signature of Message unsecure channel verK Alice’s Public Key Verifying Function verb(x, y) Input : digital signature, message Output : true or false
true if signature valid false otherwise
6
Forgery Algorithm
Mallory Everyone Else (x, y) ver Alice’s digital signature TRUE
7
If Mallory can create a valid digital signature such that verK(x, y) = TRUE for a message not previously signed by Alice, then the pair (x, y) forms a forgery unsecure channel verK Alice’s Public Key
Mallory can determine Alice’s private key (therefore can generate any number of signed messages)
Diff Goals of Attacker Assumptions
Given a message x, Mallory can determine y, such that (x, y) is a valid signature from Alice
Mallory is able to create y for some x, such that (x, y) is a valid signature from Alice
8
Difficulty Level
Mallory only has Alice’s public key (i.e. only has access to the verification function, ver)
Weak Goals of Attacker Assumptions
Mallory only has a list of messages signed by Alice (x1, y1), (x2, y2), (x3, y3), (x4, y4), …..
Mallory chooses messages x1, x2, x3, …….. and tricks Alice into providing the corresponding signatures y1, y2, y3 (resp.)
9
Strong
) , ( mod ){ ( y x return n x y x sig
a
≡ ) mod ( ){ , ( TRUE return n y x if y x ver
b
≡ ) , ( y x (n) b- a pq n q p a n b ϕ mod 1 ; private , , public , ≡ =
10
} ) , ( y x return } FALSE return else x is the message here and (x, y) the signature
) , ( mod ){ ( y x return n x y x sig
a
≡ ) mod ( ){ , ( TRUE return n y x if y x ver
b K
≡ ) , ( y x (n) b- a pq n q p a n b ϕ mod 1 ; private , , public , ≡ =
11
} ) , ( y x return } FALSE return else } ) , ( mod random a select (){ y x return n y x compute y forgery
b
≡ Key only, existential forgery
Suppose Alice creates signatures of two messages x1 and x2
) , ( mod ) ( ) , ( mod ) (
2 2 2 2 2 2 1 1 1 1 1 1
y x n x y x sig y y x n x y x sig y
a a
≡ → = ≡ → =
12
n x x y y forgery a is n y y n x x
a a
mod ) mod , mod (
2 1
2 1 2 1 2 1
≡
Mallory can use the multiplicative property of RSA to create a forgery
Known message, existential forgery
){ (x sig private , , public , q p a n b ){ , ( y x ver Incorporate a hash function in the scheme to prevent forgery
13
} ) , ( mod ) ( ){ ( y x return n z y x h z x sig
a
≡ = } ) mod ( ) ( ){ , ( FALSE return else TRUE return n y z if x h z y x ver
b K
≡ = ) , ( y x x is the message here, (x, y) the signature and h is a hash function
Preventing the First Forgery ) , ( ) ( ' . : mod ' random a select (){ y x return x h z st x preimage I compute n y z compute y forgery
st b
= ≡
14
} ) , ( y x return
Preventing the Second Forgery n x x n x h x h y y difficult is n y y n x x
a a a a
mod mod ) ( ) ( ) mod , mod (
2 1 2 1 2 1 2 1 2 1
≡ ≡
15
Another Forgery prevented } ) , ' ( ' ) ' ( ) ( . . ' : ) ( ){ , ( y x return x x and x h x h t s x find preimage II compute x h compute y x forgery
nd
≠ =
Given a valid signature (x,y) find (x’,y) creating such a forgery is equivalent to solving the 2nd preimage problem of the hash functionw
16
}
17
p p p a a Z p
a p
, , : Parameters Public mod Compute ) 1 ( Choose element primitive a be Let prime large a Choose
*
β α α β α ≡ − ≤ < ∈
Initialization
18
a p : key Private , , : Parameters Public } ) , ( ) , ( 1 mod ) ( mod 1 ) 1 , gcd( . . random secret a select ){ (
1
y x return y p k a x p p k t s k x sig
k
δ γ γ δ α γ = − − ≡ ≡ = −
−
Signing Message x
The use of a random secret k for every signature makes ElGamal non-deterministic
p p p a a Z p
a p
, , : Parameters Public mod Compute ) 1 ( Choose element primitive a be Let prime large a Choose
*
β α α β α ≡ − ≤ < ∈
Initialization
19
a p : key Private , , : Parameters Public } ) ( mod mod )){ , ( , (
2 1 2 1
FALSE return else TRUE return t t if p t compute p t compute x ver
x
= ≡ ≡
δ γγ
β α δ γ
Verifying Signature (x,y)
p p p a a Z p
a p
, , : Parameters Public mod Compute ) 1 ( Choose element primitive a be Let prime large a Choose
*
β α α β α ≡ − ≤ < ∈
Initialization
) , ( 1 mod ) ( mod random secret a select ){ (
1
y p k a x p k x sig
k
δ γ γ δ α γ = − − ≡ ≡
−
Signing Message x
) ( mod mod )){ , ( , (
2 1 2 1
TRUE return t t if p t compute p t compute x ver
x
= ≡ ≡
δ γγ
β α δ γ
Verifying Signature (x,y)
20
a p : key Private , , : Parameters Public } ) , ( ) , ( y x return y δ γ = } ) (
2 1
FALSE return else TRUE return t t if p p p p t p t p x k a that note First
x k a k a x
mod mod mod ) ( ) ( mod mod ) 1 ( mod
1 2
α α α α α γ β δ γ
δ γ δ γ δ γ
≡ ≡ + ≡ ≡ ≡ − ≡ +
+
if the signature is valid, t1 = t2 correctness
132 467 mod 2 mod 127 a 467
127
= = ≡ = 2 = = p p
a
α β α
Signature of message x = 100
21
132 =
51 466 mod 431 ) 29 2 100 ( 1 mod ) 29 467 mod 2 mod 431 1 mod ) ( 213
1 213 1
= ⋅ − = − − ( = = = = = − =
− −
p k a x p p k randomly chosen k
k
γ δ α γ
Signature of message x = 100
TRUE p p p
x
189 mod 2 mod 189 467 mod 29 132 mod
100 51 29
= = = = α γ β
δ γ
Verifying
TRUE x ver x = )) , ( , ( that such ) , ( find to needs Mallory , an Given δ γ δ γ
γ γ δ γ
β α δ α γ β δ γ
−
= ≡
x x
p t s log mod . . compute to try then , for value a Choose
This is the intractable discrete log problem Attempt 1
22
p t s
x mod
. . compute to try then , for value a Choose α γ β γ δ
δ γ
≡
This is not related to the discrete log problem. There is no known solution for this. Attempt 2
p t s
x mod
. . , usly simultaneo and for value Choose α γ β δ γ
δ γ
≡
No way known. Attempt 3
TRUE x ver x, = )) , ( , ( that such )) , ( ( an find to needs Mallory δ γ δ γ p p form p i i some choose
i
− − ≡ ≡ − ≤ ≤ ) 1 mod( mod ). 2 ( γ δ β α γ
The one-parameter forgery rgery
23
LHS p p p p p p RHS p TRUE x ver then p i x p
x i i a a i a a i i x
= ≡ ≡ ≡ ≡ ≡ ≡ ≡ = − ≡ − − ≡
+ − + +
mod mod mod mod mod mod ) ( mod )) , ( , ( , ). 1 mod( ) 1 mod( α α α α α α β β α β γ β α δ γ δ γ δ
δ δ γ γ δ δ γ δ δ γ δ γ δ γ
proof forger
TRUE x ver x, = )) , ( , ( that such )) , ( ( an find to needs Mallory δ γ δ γ p j p j i j i some choose = − − ≤ ≤ ). 1 ) 1 , gcd( ; 2 , ( ,
The two-parameter forgery
24
TRUE x ver then p ij x p j p form p j p j i j i some choose
j i
= − ≡ − − ≡ ≡ = − − ≤ ≤
− −
)) , ( , ( , ). 1 mod( ) 1 mod( mod ). 1 ) 1 , gcd( ; 2 , ( ,
1 1
δ γ γ γ δ β α γ
forgery Prevent Existential Forgeries by hashing the message
) , ( ) , ( 1 mod ) ( mod random secret a select ){ (
1
y x return y p k a x p k x sig
k
δ γ γ δ α γ = − − ≡ ≡
−
). 1 mod( ) ( follows as computed be can secret 1 ) 1 , gcd(
1
− − = = −
−
p k x a a then p if γ δ γ
25
} ) , ( y x return
The secret key ‘a’ is retrieved and Mallory can create many forgeries
mod random secret a select ){ ( p k x sig
k
α γ ≡
−
, ) ( ) (
2 1
then and are signatures The k same the with signed x and x messages different two have we say Lets
2 1
, , δ γ δ γ
26
} ) , ( ) , ( 1 mod ) (
1
y x return y p k a x δ γ γ δ = − − ≡
−
dividing Representing in terms of α =>
Improper use of ElGamal’s Signature Scheme
27
) ,δ γ (
28
q p p q a a q q p q t s bit q bit p
a
, , , : Parameters Public mod Compute ) 1 ( Choose )
subgroup a creates (
Find 1 | . . ) 160 ( prime another Choose ) 1024 ( prime large a Choose β α α β α α ≡ − ≤ < −
Initialization choose some α And compute
29
a q p : key Private , , , : Parameters Public β α
And compute α(p-1)/q mod p
q p p q a a q q p q t s bit q bit p
a
, , , : Parameters Public mod Compute ) 1 ( Choose )
subgroup a creates (
Find 1 | . . ) 160 ( prime another Choose ) 1024 ( prime large a Choose β α α β α α ≡ − ≤ < −
Initialization
30
a q p : key Private , , , : Parameters Public β α } ) , ( ) , ( mod ) ) ( ( mod ) mod ( 1 ) , gcd( . . random secret a select ){ (
1
y x return y q k a x SHA q p q k t s k x sig
k
δ γ γ δ α γ = + ≡ ≡ =
−
Signing Message x
The use of a random secret k for every signature makes ElGamal non-deterministic
q p p q a a q q p q t s bit q bit p
a
, , , : Parameters Public mod Compute ) 1 ( Choose )
subgroup a creates (
Find 1 | . . ) 160 ( prime another Choose ) 1024 ( prime large a Choose β α α β α α ≡ − ≤ < −
Initialization
31
a q p : key Private , , , : Parameters Public β α } ) , ( ) , ( mod ) ) ( ( mod ) mod ( 1 ) , gcd( . . random secret a select ){ (
1
y x return y q k a x SHA q p q k t s k x sig
k
δ γ γ δ α γ = + ≡ ≡ =
−
Signing Message x
} ) mod ( mod ) mod ( mod mod ) ( mod )){ , ( , (
2 1
2 1 1
FALSE return else TRUE return q v if q p v compute q w t compute q x SHA w t compute q w compute x ver
t t
γ β α γ δ δ γ ≡ ⋅ ≡ ⋅ ≡ ⋅ ≡ ≡
−
Verifying Signature
a p q p
a
: key Private ) mod ( , , , : Parameters Public α β β α ≡
Initialization
mod ) ) ( ( mod ) mod ( 1 ) , gcd( . . random secret a select ){ (
1
q k a x SHA q p q k t s k x sig
k
γ δ α γ + ≡ ≡ =
−
Signing Message x
mod ) mod ( mod mod ) ( mod )){ , ( , (
2 1
2 1 1
q p v compute q w t compute q x SHA w t compute q w compute x ver
t t
β α γ δ δ γ ⋅ ≡ ⋅ ≡ ⋅ ≡ ≡
−
Verifying Signature
32
} ) , ( ) , ( mod ) ) ( ( y x return y q k a x SHA δ γ γ δ = + ≡ } ) mod ( mod ) mod ( FALSE return else TRUE return q v if q p v compute γ β α ≡ ⋅ ≡
q at t k q wa x wSHA q a x SHA k q k a x SHA mod ) ( mod ) ) ( mod ) ) ( mod ) ) (
2 1 1 1
+ ≡ + ( = + ( ≡ + ( ≡
− −
γ δ γ γ δ q p sides both
q Take p p
t t t t k q at t k
mod ) mod ( mod mod mod
2 1 2 1 2 1
mod ) (
β α γ β α α α α ≡ ≡ ≡
+
33
Could you techniques such as Index Calculus. For a 1024 bit p, this method offers security of 80 bits Cannot apply Index Calculus relies on Pollard rho for solving the discrete log, For 160 bit q, this offers security of 80 bits
34
Could you techniques such as Index Calculus. For a 1024 bit p, this method offers security of 80 bits Cannot apply Index Calculus relies on Pollard rho for solving the discrete log, For 160 bit q, this offers security of 80 bits Thus the size of p dictates the size of q.
a q q a a p p Z p q and bits size
q bits size
p
a q p p
: Private mod Compute ) ( from randomly Choose mod 1
root q the is mod then element primitive a be Let ) 1 ( | ) 160 ( prime smaller a Choose ) 1024 ( prime large a Choose
th / ) 1 ( *
α β α α α = < ≤ = ∈ −
−
Initialization
35
q p a , , : Private : Private β α, } ) , ( ) , ( mod ) mod || ( . 1 1 . . random secret a select ){ ( y x return y p a k p x h q k t s k x sig
k
δ γ γ δ α γ = + = = − ≤ ≤
Signing Message x
} ) ( ) mod || ( )){ , ( , (
1 1
FALSE return else TRUE return t if p x h t compute x ver γ β α δ γ
γ δ
= ≡
−
Verifying Signature (x,y)