Mangers Attack revisited Falko Strenzke 1 1 - FlexSecure GmbH, - - PowerPoint PPT Presentation

manger s attack revisited
SMART_READER_LITE
LIVE PREVIEW

Mangers Attack revisited Falko Strenzke 1 1 - FlexSecure GmbH, - - PowerPoint PPT Presentation

Mangers Attack revisited Falko Strenzke 1 1 - FlexSecure GmbH, Germany, strenzke@flexsecure.de February 8, 2013 Mangers Attack revisited Falko Strenzke 1 / 1 Mangers Attack RSA-OAEP Encoding introduced to thwart Bleichenbachers


slide-1
SLIDE 1

Manger’s Attack revisited

Falko Strenzke1

1 - FlexSecure GmbH, Germany, strenzke@flexsecure.de

February 8, 2013

Manger’s Attack revisited Falko Strenzke 1 / 1

slide-2
SLIDE 2

Manger’s Attack

RSA-OAEP Encoding introduced to thwart Bleichenbacher’s Attack against RSA with PKCS#1 v1.5 Encoding The OAEP is a so called CCA2 conversion that secures a cryptosystem against adaptive chosen ciphertext attacks (any manipulation of an original ciphertext is detected during the decryption) CRYPTO 2001: James Manger introduces a Fault/Timing Attack against straightforward implementations of RSA-OAEP

Manger’s Attack revisited Falko Strenzke 2 / 1

slide-3
SLIDE 3

Manger’s Attack

RSA-OAEP Encoding introduced to thwart Bleichenbacher’s Attack against RSA with PKCS#1 v1.5 Encoding The OAEP is a so called CCA2 conversion that secures a cryptosystem against adaptive chosen ciphertext attacks (any manipulation of an original ciphertext is detected during the decryption) CRYPTO 2001: James Manger introduces a Fault/Timing Attack against straightforward implementations of RSA-OAEP

Manger’s Attack revisited Falko Strenzke 2 / 1

slide-4
SLIDE 4

Manger’s Attack

RSA-OAEP Encoding introduced to thwart Bleichenbacher’s Attack against RSA with PKCS#1 v1.5 Encoding The OAEP is a so called CCA2 conversion that secures a cryptosystem against adaptive chosen ciphertext attacks (any manipulation of an original ciphertext is detected during the decryption) CRYPTO 2001: James Manger introduces a Fault/Timing Attack against straightforward implementations of RSA-OAEP

Manger’s Attack revisited Falko Strenzke 2 / 1

slide-5
SLIDE 5

Manger’s Attack

RSA-OAEP Encoding introduced to thwart Bleichenbacher’s Attack against RSA with PKCS#1 v1.5 Encoding The OAEP is a so called CCA2 conversion that secures a cryptosystem against adaptive chosen ciphertext attacks (any manipulation of an original ciphertext is detected during the decryption) CRYPTO 2001: James Manger introduces a Fault/Timing Attack against straightforward implementations of RSA-OAEP

Manger’s Attack revisited Falko Strenzke 2 / 1

slide-6
SLIDE 6

RSA

public key: public exponent e and public modulus n private key: private exponent d with xed = x mod n encryption: z = me mod n decryption: m = zd = med mod n

Manger’s Attack revisited Falko Strenzke 3 / 1

slide-7
SLIDE 7

RSA

public key: public exponent e and public modulus n private key: private exponent d with xed = x mod n encryption: z = me mod n decryption: m = zd = med mod n

Manger’s Attack revisited Falko Strenzke 3 / 1

slide-8
SLIDE 8

RSA

public key: public exponent e and public modulus n private key: private exponent d with xed = x mod n encryption: z = me mod n decryption: m = zd = med mod n

Manger’s Attack revisited Falko Strenzke 3 / 1

slide-9
SLIDE 9

RSA

public key: public exponent e and public modulus n private key: private exponent d with xed = x mod n encryption: z = me mod n decryption: m = zd = med mod n

Manger’s Attack revisited Falko Strenzke 3 / 1

slide-10
SLIDE 10

OAEP Encoding

Figure: The RSA-OAEP decoding procedure. Here, denotes XOR.

Manger’s Attack revisited Falko Strenzke 4 / 1

slide-11
SLIDE 11

Manger’s Attack - the observable Error Condition

OAEP Decoding checks that Y = 0 (Y = 0 → “supernumerary octet”) Y = 0 can be learned either through

a specific error message shorter time to the error message compared to later OAEP errors (time difference might become huge if the attacker can control the public parameters to be hashed within the OAEP decoding routine)

Manger’s Attack revisited Falko Strenzke 5 / 1

slide-12
SLIDE 12

Manger’s Attack - the observable Error Condition

OAEP Decoding checks that Y = 0 (Y = 0 → “supernumerary octet”) Y = 0 can be learned either through

a specific error message shorter time to the error message compared to later OAEP errors (time difference might become huge if the attacker can control the public parameters to be hashed within the OAEP decoding routine)

Manger’s Attack revisited Falko Strenzke 5 / 1

slide-13
SLIDE 13

Manger’s Attack - the observable Error Condition

OAEP Decoding checks that Y = 0 (Y = 0 → “supernumerary octet”) Y = 0 can be learned either through

a specific error message shorter time to the error message compared to later OAEP errors (time difference might become huge if the attacker can control the public parameters to be hashed within the OAEP decoding routine)

Manger’s Attack revisited Falko Strenzke 5 / 1

slide-14
SLIDE 14

Manger’s Attack - the observable Error Condition

OAEP Decoding checks that Y = 0 (Y = 0 → “supernumerary octet”) Y = 0 can be learned either through

a specific error message shorter time to the error message compared to later OAEP errors (time difference might become huge if the attacker can control the public parameters to be hashed within the OAEP decoding routine)

Manger’s Attack revisited Falko Strenzke 5 / 1

slide-15
SLIDE 15

Manger’s Attack - the observable Error Condition

OAEP Decoding checks that Y = 0 (Y = 0 → “supernumerary octet”) Y = 0 can be learned either through

a specific error message shorter time to the error message compared to later OAEP errors (time difference might become huge if the attacker can control the public parameters to be hashed within the OAEP decoding routine)

Manger’s Attack revisited Falko Strenzke 5 / 1

slide-16
SLIDE 16

Manger’s Attack - the observable Error Condition

OAEP Decoding checks that Y = 0 (Y = 0 → “supernumerary octet”) Y = 0 can be learned either through

a specific error message shorter time to the error message compared to later OAEP errors (time difference might become huge if the attacker can control the public parameters to be hashed within the OAEP decoding routine)

Manger’s Attack revisited Falko Strenzke 5 / 1

slide-17
SLIDE 17

Manger’s Attack - the Information Gain

The attacker wants to decrypt the ciphertext c0 = me

0 mod n

He chooses f ∈ {0, 1, . . . , n − 1} He creates ciphertexts cf = f ec0 = (fm0)e mod n He observes the decryption of cf If Y = 0 he learns fm0 mod n ≥ B Manger gives a specific strategy how to choose f initially and how to adapt f in in subsequent queries

Manger’s Attack revisited Falko Strenzke 6 / 1

slide-18
SLIDE 18

Manger’s Attack - the Information Gain

The attacker wants to decrypt the ciphertext c0 = me

0 mod n

He chooses f ∈ {0, 1, . . . , n − 1} He creates ciphertexts cf = f ec0 = (fm0)e mod n He observes the decryption of cf If Y = 0 he learns fm0 mod n ≥ B Manger gives a specific strategy how to choose f initially and how to adapt f in in subsequent queries

Manger’s Attack revisited Falko Strenzke 6 / 1

slide-19
SLIDE 19

Manger’s Attack - the Information Gain

The attacker wants to decrypt the ciphertext c0 = me

0 mod n

He chooses f ∈ {0, 1, . . . , n − 1} He creates ciphertexts cf = f ec0 = (fm0)e mod n He observes the decryption of cf If Y = 0 he learns fm0 mod n ≥ B Manger gives a specific strategy how to choose f initially and how to adapt f in in subsequent queries

Manger’s Attack revisited Falko Strenzke 6 / 1

slide-20
SLIDE 20

Manger’s Attack - the Information Gain

The attacker wants to decrypt the ciphertext c0 = me

0 mod n

He chooses f ∈ {0, 1, . . . , n − 1} He creates ciphertexts cf = f ec0 = (fm0)e mod n He observes the decryption of cf If Y = 0 he learns fm0 mod n ≥ B Manger gives a specific strategy how to choose f initially and how to adapt f in in subsequent queries

Manger’s Attack revisited Falko Strenzke 6 / 1

slide-21
SLIDE 21

Manger’s Attack - the Information Gain

The attacker wants to decrypt the ciphertext c0 = me

0 mod n

He chooses f ∈ {0, 1, . . . , n − 1} He creates ciphertexts cf = f ec0 = (fm0)e mod n He observes the decryption of cf If Y = 0 he learns fm0 mod n ≥ B Manger gives a specific strategy how to choose f initially and how to adapt f in in subsequent queries

Manger’s Attack revisited Falko Strenzke 6 / 1

slide-22
SLIDE 22

Manger’s Attack - the Information Gain

The attacker wants to decrypt the ciphertext c0 = me

0 mod n

He chooses f ∈ {0, 1, . . . , n − 1} He creates ciphertexts cf = f ec0 = (fm0)e mod n He observes the decryption of cf If Y = 0 he learns fm0 mod n ≥ B Manger gives a specific strategy how to choose f initially and how to adapt f in in subsequent queries

Manger’s Attack revisited Falko Strenzke 6 / 1

slide-23
SLIDE 23

Manger’s Attack - the Information Gain

The attacker wants to decrypt the ciphertext c0 = me

0 mod n

He chooses f ∈ {0, 1, . . . , n − 1} He creates ciphertexts cf = f ec0 = (fm0)e mod n He observes the decryption of cf If Y = 0 he learns fm0 mod n ≥ B Manger gives a specific strategy how to choose f initially and how to adapt f in in subsequent queries

Manger’s Attack revisited Falko Strenzke 6 / 1

slide-24
SLIDE 24

Manger’s Attack revisited Falko Strenzke 7 / 1

slide-25
SLIDE 25

Analysis of the OpenSSL Library

lzero = num - flen; if (lzero < 0) { /* signalling this error immediately after detection might allow for * side-channel attacks (e.g. timing if ’plen’ is huge – cf. James * H. Manger, ”A Chosen Ciphertext Attack on RSA Optimal * Asymmetric Encryption Padding (OAEP) [...]”, CRYPTO 2001), * so we use a ’bad’ flag */ bad = 1; lzero = 0; flen = num; /* don’t overflow the memcpy to padded from */ } . . . if (memcmp(db, phash, SHA DIGEST LENGTH) != 0 || bad) goto decoding err;

Manger’s Attack revisited Falko Strenzke 8 / 1

slide-26
SLIDE 26

Analysis of the Botan Library

. . . key length /= 8; if(in length > key length) throw Decoding Error(”Invalid EME1 encoding”); SecureVector<byte> tmp(key length); tmp.copy(key length - in length, in, in length); mgf->mask(tmp + HASH LENGTH, tmp.size() - HASH LENGTH, tmp, HASH LENGTH); mgf->mask(tmp, HASH LENGTH, tmp + HASH LENGTH, tmp.size() - HASH LENGTH); for(u32bit j = 0; j != Phash.size(); ++j) if(tmp[j+HASH LENGTH] != Phash[j]) throw Decoding Error(”Invalid EME1 encoding”); . . .

Manger’s Attack revisited Falko Strenzke 9 / 1

slide-27
SLIDE 27

Analysis of OpenSSL and Botan

the strongest form of Manger’s Attack (exploiting the running time of hash computation of huge Parameters) is not possible for either library OpenSSL did not respond to the report of the potential vulnerability The Botan main developer released a patch after the vulnerability was reported to him

Manger’s Attack revisited Falko Strenzke 10 / 1

slide-28
SLIDE 28

Analysis of OpenSSL and Botan

the strongest form of Manger’s Attack (exploiting the running time of hash computation of huge Parameters) is not possible for either library OpenSSL did not respond to the report of the potential vulnerability The Botan main developer released a patch after the vulnerability was reported to him

Manger’s Attack revisited Falko Strenzke 10 / 1

slide-29
SLIDE 29

Analysis of OpenSSL and Botan

the strongest form of Manger’s Attack (exploiting the running time of hash computation of huge Parameters) is not possible for either library OpenSSL did not respond to the report of the potential vulnerability The Botan main developer released a patch after the vulnerability was reported to him

Manger’s Attack revisited Falko Strenzke 10 / 1

slide-30
SLIDE 30

Manger’s Attack revisited Falko Strenzke 11 / 1

slide-31
SLIDE 31

A new potential Vulnerability in the Integer to Octet String Conversion

void BigInt::binary encode(byte output[]) const { const u32bit sig bytes = bytes(); for(u32bit j = 0; j != sig bytes; ++j)

  • utput[sig bytes-j-1] = byte at(j);

}

the running time of this routine obviously depends on the number of octets of the encoded integer → potential timing or power vulnerability! independent of encoding method the integer encoding routine in OpenSSL is equivalent

Manger’s Attack revisited Falko Strenzke 12 / 1

slide-32
SLIDE 32

A new potential Vulnerability in the Integer to Octet String Conversion

void BigInt::binary encode(byte output[]) const { const u32bit sig bytes = bytes(); for(u32bit j = 0; j != sig bytes; ++j)

  • utput[sig bytes-j-1] = byte at(j);

}

the running time of this routine obviously depends on the number of octets of the encoded integer → potential timing or power vulnerability! independent of encoding method the integer encoding routine in OpenSSL is equivalent

Manger’s Attack revisited Falko Strenzke 12 / 1

slide-33
SLIDE 33

A new potential Vulnerability in the Integer to Octet String Conversion

void BigInt::binary encode(byte output[]) const { const u32bit sig bytes = bytes(); for(u32bit j = 0; j != sig bytes; ++j)

  • utput[sig bytes-j-1] = byte at(j);

}

the running time of this routine obviously depends on the number of octets of the encoded integer → potential timing or power vulnerability! independent of encoding method the integer encoding routine in OpenSSL is equivalent

Manger’s Attack revisited Falko Strenzke 12 / 1

slide-34
SLIDE 34

A new potential Vulnerability in the Integer to Octet String Conversion

void BigInt::binary encode(byte output[]) const { const u32bit sig bytes = bytes(); for(u32bit j = 0; j != sig bytes; ++j)

  • utput[sig bytes-j-1] = byte at(j);

}

the running time of this routine obviously depends on the number of octets of the encoded integer → potential timing or power vulnerability! independent of encoding method the integer encoding routine in OpenSSL is equivalent

Manger’s Attack revisited Falko Strenzke 12 / 1

slide-35
SLIDE 35

Manger’s Attack revisited Falko Strenzke 13 / 1

slide-36
SLIDE 36

A potential Vulnerability in the Multi-Precision Integer (MPI) Arithmetic

We take a look back one step further from the integer encoding routine with respect to conditional branching based on Y = 0 We choose the PolarSSL Library for embedded systems We assume the last operation of the RSA computation to be a modular reduction implemented as a division in PolarSSL, the result of the division is copied with routine mpi copy()

Manger’s Attack revisited Falko Strenzke 14 / 1

slide-37
SLIDE 37

A potential Vulnerability in the Multi-Precision Integer (MPI) Arithmetic

We take a look back one step further from the integer encoding routine with respect to conditional branching based on Y = 0 We choose the PolarSSL Library for embedded systems We assume the last operation of the RSA computation to be a modular reduction implemented as a division in PolarSSL, the result of the division is copied with routine mpi copy()

Manger’s Attack revisited Falko Strenzke 14 / 1

slide-38
SLIDE 38

A potential Vulnerability in the Multi-Precision Integer (MPI) Arithmetic

We take a look back one step further from the integer encoding routine with respect to conditional branching based on Y = 0 We choose the PolarSSL Library for embedded systems We assume the last operation of the RSA computation to be a modular reduction implemented as a division in PolarSSL, the result of the division is copied with routine mpi copy()

Manger’s Attack revisited Falko Strenzke 14 / 1

slide-39
SLIDE 39

A potential Vulnerability in the Multi-Precision Integer (MPI) Arithmetic

We take a look back one step further from the integer encoding routine with respect to conditional branching based on Y = 0 We choose the PolarSSL Library for embedded systems We assume the last operation of the RSA computation to be a modular reduction implemented as a division in PolarSSL, the result of the division is copied with routine mpi copy()

Manger’s Attack revisited Falko Strenzke 14 / 1

slide-40
SLIDE 40

A potential Vulnerability in the Multi-Precision Integer (MPI) Arithmetic

We take a look back one step further from the integer encoding routine with respect to conditional branching based on Y = 0 We choose the PolarSSL Library for embedded systems We assume the last operation of the RSA computation to be a modular reduction implemented as a division in PolarSSL, the result of the division is copied with routine mpi copy()

Manger’s Attack revisited Falko Strenzke 14 / 1

slide-41
SLIDE 41

The mpi copy() Routine in the PolarSSL Library

typedef struct { int n; U8 *p; } mpi; int mpi copy( mpi *X, const mpi *Z ) { // Z is src int ret, i; if( X == Z ) return( 0 ); for( i = Z->n - 1; i > 0; i - - ) if( Z->p[i] != 0 ) break; i++; // i = # significant words in Z (src) X->s = Z->s; MPI CHK( mpi grow( X, i ) ); memset( X->p, 0, X->n * ciL ); memcpy( X->p, Z->p, i* ciL ); . . . }

Manger’s Attack revisited Falko Strenzke 15 / 1

slide-42
SLIDE 42

The mpi copy() Routine in the PolarSSL Library

Manger’s Attack revisited Falko Strenzke 16 / 1

slide-43
SLIDE 43

The mpi copy() Routine in the PolarSSL Library

the call to memcpy (potentially) offers a plain dependency of the running time on “Y = 0?”

  • ther routines in this function also show such dependencies

(also with opposed timing effects regarding Y = 0) but depend on the history of source and destination MPI

  • perands

→ must be accounted for in a concrete implementation

Manger’s Attack revisited Falko Strenzke 17 / 1

slide-44
SLIDE 44

The mpi copy() Routine in the PolarSSL Library

the call to memcpy (potentially) offers a plain dependency of the running time on “Y = 0?”

  • ther routines in this function also show such dependencies

(also with opposed timing effects regarding Y = 0) but depend on the history of source and destination MPI

  • perands

→ must be accounted for in a concrete implementation

Manger’s Attack revisited Falko Strenzke 17 / 1

slide-45
SLIDE 45

The mpi copy() Routine in the PolarSSL Library

the call to memcpy (potentially) offers a plain dependency of the running time on “Y = 0?”

  • ther routines in this function also show such dependencies

(also with opposed timing effects regarding Y = 0) but depend on the history of source and destination MPI

  • perands

→ must be accounted for in a concrete implementation

Manger’s Attack revisited Falko Strenzke 17 / 1

slide-46
SLIDE 46

The mpi copy() Routine in the PolarSSL Library

the call to memcpy (potentially) offers a plain dependency of the running time on “Y = 0?”

  • ther routines in this function also show such dependencies

(also with opposed timing effects regarding Y = 0) but depend on the history of source and destination MPI

  • perands

→ must be accounted for in a concrete implementation

Manger’s Attack revisited Falko Strenzke 17 / 1

slide-47
SLIDE 47

The mpi copy() Routine in the PolarSSL Library

the call to memcpy (potentially) offers a plain dependency of the running time on “Y = 0?”

  • ther routines in this function also show such dependencies

(also with opposed timing effects regarding Y = 0) but depend on the history of source and destination MPI

  • perands

→ must be accounted for in a concrete implementation

Manger’s Attack revisited Falko Strenzke 17 / 1

slide-48
SLIDE 48

Impact of the keysize on the MPI related Vulnerability

RSA key size: bit length of the public modulus n typical key sizes are multiples of 32 (powers of two) with untypical keysizes the MPI related vulnerabilities are also possible with 32-bit words

Manger’s Attack revisited Falko Strenzke 18 / 1

slide-49
SLIDE 49

Impact of the keysize on the MPI related Vulnerability

RSA key size: bit length of the public modulus n typical key sizes are multiples of 32 (powers of two) with untypical keysizes the MPI related vulnerabilities are also possible with 32-bit words

Manger’s Attack revisited Falko Strenzke 18 / 1

slide-50
SLIDE 50

Impact of the keysize on the MPI related Vulnerability

RSA key size: bit length of the public modulus n typical key sizes are multiples of 32 (powers of two) with untypical keysizes the MPI related vulnerabilities are also possible with 32-bit words

Manger’s Attack revisited Falko Strenzke 18 / 1

slide-51
SLIDE 51

Impact of the keysize on the MPI related Vulnerability

for such untypical key sizes Y = 0 means that the number of words in m is smaller by one compared to Y = 0

Manger’s Attack revisited Falko Strenzke 19 / 1

slide-52
SLIDE 52

Impact of the keysize on the MPI related Vulnerability

for such untypical key sizes Y = 0 means that the number of words in m is smaller by one compared to Y = 0

Manger’s Attack revisited Falko Strenzke 19 / 1

slide-53
SLIDE 53

Manger’s Attack revisited Falko Strenzke 20 / 1

slide-54
SLIDE 54

On the relevance of the new potential Vulnerabilities

we have identified “unbalanced conditional branching” based

  • n a message property

this gives an onset for timing attacks (TA) and simple power analysis attacks (SPA) (refined TA revealing the running time of individual subroutines) from the point of view of security engineering, any implementation must analyzed with respect to these vulnerabilities

Manger’s Attack revisited Falko Strenzke 21 / 1

slide-55
SLIDE 55

On the relevance of the new potential Vulnerabilities

we have identified “unbalanced conditional branching” based

  • n a message property

this gives an onset for timing attacks (TA) and simple power analysis attacks (SPA) (refined TA revealing the running time of individual subroutines) from the point of view of security engineering, any implementation must analyzed with respect to these vulnerabilities

Manger’s Attack revisited Falko Strenzke 21 / 1

slide-56
SLIDE 56

On the relevance of the new potential Vulnerabilities

we have identified “unbalanced conditional branching” based

  • n a message property

this gives an onset for timing attacks (TA) and simple power analysis attacks (SPA) (refined TA revealing the running time of individual subroutines) from the point of view of security engineering, any implementation must analyzed with respect to these vulnerabilities

Manger’s Attack revisited Falko Strenzke 21 / 1

slide-57
SLIDE 57

On the relevance of the new potential Vulnerabilities

we have identified “unbalanced conditional branching” based

  • n a message property

this gives an onset for timing attacks (TA) and simple power analysis attacks (SPA) (refined TA revealing the running time of individual subroutines) from the point of view of security engineering, any implementation must analyzed with respect to these vulnerabilities

Manger’s Attack revisited Falko Strenzke 21 / 1

slide-58
SLIDE 58

On the relevance of these potential Vulnerabilities

platform properties influencing the exploitability: source code hardware compiler “accessibility” for an attacker (timing / power)

Manger’s Attack revisited Falko Strenzke 22 / 1

slide-59
SLIDE 59

On the relevance of these potential Vulnerabilities

platform properties influencing the exploitability: source code hardware compiler “accessibility” for an attacker (timing / power)

Manger’s Attack revisited Falko Strenzke 22 / 1

slide-60
SLIDE 60

On the relevance of these potential Vulnerabilities

platform properties influencing the exploitability: source code hardware compiler “accessibility” for an attacker (timing / power)

Manger’s Attack revisited Falko Strenzke 22 / 1

slide-61
SLIDE 61

On the relevance of these potential Vulnerabilities

platform properties influencing the exploitability: source code hardware compiler “accessibility” for an attacker (timing / power)

Manger’s Attack revisited Falko Strenzke 22 / 1

slide-62
SLIDE 62

On the relevance of these potential Vulnerabilities

platform properties influencing the exploitability: source code ← solve problem here for TA hardware compiler “accessibility” for an attacker (timing / power)

Manger’s Attack revisited Falko Strenzke 22 / 1

slide-63
SLIDE 63

Manger’s Attack revisited Falko Strenzke 23 / 1

slide-64
SLIDE 64

Previously proposed Countermeasures

Previously proposed countermeasures incurr security threats: (1) if Y = 0, one shall used randomly generated dummy values in the further OAEP decoding → threat: random values turn an otherwise deterministic processing indeterministic, which might be detected through side channels by repeatedly decrypting the same ciphertext (2) if Y = 0, one shall set the m = 0 . . . 0 in the further OAEP decoding → threat: an “all zero” octet string is an extreme case of low Hamming weight and might very likely be detected through power analysis

Manger’s Attack revisited Falko Strenzke 24 / 1

slide-65
SLIDE 65

Previously proposed Countermeasures

Previously proposed countermeasures incurr security threats: (1) if Y = 0, one shall used randomly generated dummy values in the further OAEP decoding → threat: random values turn an otherwise deterministic processing indeterministic, which might be detected through side channels by repeatedly decrypting the same ciphertext (2) if Y = 0, one shall set the m = 0 . . . 0 in the further OAEP decoding → threat: an “all zero” octet string is an extreme case of low Hamming weight and might very likely be detected through power analysis

Manger’s Attack revisited Falko Strenzke 24 / 1

slide-66
SLIDE 66

Previously proposed Countermeasures

Previously proposed countermeasures incurr security threats: (1) if Y = 0, one shall used randomly generated dummy values in the further OAEP decoding → threat: random values turn an otherwise deterministic processing indeterministic, which might be detected through side channels by repeatedly decrypting the same ciphertext (2) if Y = 0, one shall set the m = 0 . . . 0 in the further OAEP decoding → threat: an “all zero” octet string is an extreme case of low Hamming weight and might very likely be detected through power analysis

Manger’s Attack revisited Falko Strenzke 24 / 1

slide-67
SLIDE 67

Previously proposed Countermeasures

Previously proposed countermeasures incurr security threats: (1) if Y = 0, one shall used randomly generated dummy values in the further OAEP decoding → threat: random values turn an otherwise deterministic processing indeterministic, which might be detected through side channels by repeatedly decrypting the same ciphertext (2) if Y = 0, one shall set the m = 0 . . . 0 in the further OAEP decoding → threat: an “all zero” octet string is an extreme case of low Hamming weight and might very likely be detected through power analysis

Manger’s Attack revisited Falko Strenzke 24 / 1

slide-68
SLIDE 68

Previously proposed Countermeasures

Previously proposed countermeasures incurr security threats: (1) if Y = 0, one shall used randomly generated dummy values in the further OAEP decoding → threat: random values turn an otherwise deterministic processing indeterministic, which might be detected through side channels by repeatedly decrypting the same ciphertext (2) if Y = 0, one shall set the m = 0 . . . 0 in the further OAEP decoding → threat: an “all zero” octet string is an extreme case of low Hamming weight and might very likely be detected through power analysis

Manger’s Attack revisited Falko Strenzke 24 / 1

slide-69
SLIDE 69

Effective Countermeasures against Timing Attacks

We give a countermeasure against the MPI encoding routine: C++ source code number of iterations in the encoding routine depends only on the key size enforces Y = 0 already in the encoding routine uses the volatile specifier to take away the compilers ability to remove unnecessary operations use no conditional branching, not even comparison operators but only logical operations logical masking replaces conditional branching

Manger’s Attack revisited Falko Strenzke 25 / 1

slide-70
SLIDE 70

Effective Countermeasures against Timing Attacks

We give a countermeasure against the MPI encoding routine: C++ source code number of iterations in the encoding routine depends only on the key size enforces Y = 0 already in the encoding routine uses the volatile specifier to take away the compilers ability to remove unnecessary operations use no conditional branching, not even comparison operators but only logical operations logical masking replaces conditional branching

Manger’s Attack revisited Falko Strenzke 25 / 1

slide-71
SLIDE 71

Effective Countermeasures against Timing Attacks

We give a countermeasure against the MPI encoding routine: C++ source code number of iterations in the encoding routine depends only on the key size enforces Y = 0 already in the encoding routine uses the volatile specifier to take away the compilers ability to remove unnecessary operations use no conditional branching, not even comparison operators but only logical operations logical masking replaces conditional branching

Manger’s Attack revisited Falko Strenzke 25 / 1

slide-72
SLIDE 72

Effective Countermeasures against Timing Attacks

We give a countermeasure against the MPI encoding routine: C++ source code number of iterations in the encoding routine depends only on the key size enforces Y = 0 already in the encoding routine uses the volatile specifier to take away the compilers ability to remove unnecessary operations use no conditional branching, not even comparison operators but only logical operations logical masking replaces conditional branching

Manger’s Attack revisited Falko Strenzke 25 / 1

slide-73
SLIDE 73

Effective Countermeasures against Timing Attacks

We give a countermeasure against the MPI encoding routine: C++ source code number of iterations in the encoding routine depends only on the key size enforces Y = 0 already in the encoding routine uses the volatile specifier to take away the compilers ability to remove unnecessary operations use no conditional branching, not even comparison operators but only logical operations logical masking replaces conditional branching

Manger’s Attack revisited Falko Strenzke 25 / 1

slide-74
SLIDE 74

Effective Countermeasures against Timing Attacks

We give a countermeasure against the MPI encoding routine: C++ source code number of iterations in the encoding routine depends only on the key size enforces Y = 0 already in the encoding routine uses the volatile specifier to take away the compilers ability to remove unnecessary operations use no conditional branching, not even comparison operators but only logical operations logical masking replaces conditional branching

Manger’s Attack revisited Falko Strenzke 25 / 1

slide-75
SLIDE 75

Effective Countermeasures against Timing Attacks

We give a countermeasure against the MPI encoding routine: C++ source code number of iterations in the encoding routine depends only on the key size enforces Y = 0 already in the encoding routine uses the volatile specifier to take away the compilers ability to remove unnecessary operations use no conditional branching, not even comparison operators but only logical operations logical masking replaces conditional branching

Manger’s Attack revisited Falko Strenzke 25 / 1

slide-76
SLIDE 76

Effective Countermeasures against Timing Attacks

We give a countermeasure against the MPI encoding routine: C++ source code number of iterations in the encoding routine depends only on the key size enforces Y = 0 already in the encoding routine uses the volatile specifier to take away the compilers ability to remove unnecessary operations use no conditional branching, not even comparison operators but only logical operations logical masking replaces conditional branching

Manger’s Attack revisited Falko Strenzke 25 / 1

slide-77
SLIDE 77

Outline of Countermeasures for the MPI Arithmetic

The last MPI routines in the decryption must “hide” the number of words of m this can be done in the same manner as protecting the the MPI encoding routine

Manger’s Attack revisited Falko Strenzke 26 / 1

slide-78
SLIDE 78

Outline of Countermeasures for the MPI Arithmetic

The last MPI routines in the decryption must “hide” the number of words of m this can be done in the same manner as protecting the the MPI encoding routine

Manger’s Attack revisited Falko Strenzke 26 / 1

slide-79
SLIDE 79

Manger’s Attack revisited Falko Strenzke 27 / 1

slide-80
SLIDE 80

Conclusion

concerning the OpenSSL countermeasure, it is obvious that there is no common notion concerning the relevance of the leakage of “small” timing differences (compare with cache-timing attacks against AES, where minimal timing differences are regarded as critical) even though Manger’s Attack is known for almost 10 years, we could find new leakages about crucial properties of the message

in the MPI encoding routines in the MPI arithmetic (under certain circumstances)

we propose countermeasures that ensure running times only dependent on the key size for the potentially vulnerable routines

Manger’s Attack revisited Falko Strenzke 28 / 1

slide-81
SLIDE 81

Conclusion

concerning the OpenSSL countermeasure, it is obvious that there is no common notion concerning the relevance of the leakage of “small” timing differences (compare with cache-timing attacks against AES, where minimal timing differences are regarded as critical) even though Manger’s Attack is known for almost 10 years, we could find new leakages about crucial properties of the message

in the MPI encoding routines in the MPI arithmetic (under certain circumstances)

we propose countermeasures that ensure running times only dependent on the key size for the potentially vulnerable routines

Manger’s Attack revisited Falko Strenzke 28 / 1

slide-82
SLIDE 82

Conclusion

concerning the OpenSSL countermeasure, it is obvious that there is no common notion concerning the relevance of the leakage of “small” timing differences (compare with cache-timing attacks against AES, where minimal timing differences are regarded as critical) even though Manger’s Attack is known for almost 10 years, we could find new leakages about crucial properties of the message

in the MPI encoding routines in the MPI arithmetic (under certain circumstances)

we propose countermeasures that ensure running times only dependent on the key size for the potentially vulnerable routines

Manger’s Attack revisited Falko Strenzke 28 / 1

slide-83
SLIDE 83

Conclusion

concerning the OpenSSL countermeasure, it is obvious that there is no common notion concerning the relevance of the leakage of “small” timing differences (compare with cache-timing attacks against AES, where minimal timing differences are regarded as critical) even though Manger’s Attack is known for almost 10 years, we could find new leakages about crucial properties of the message

in the MPI encoding routines in the MPI arithmetic (under certain circumstances)

we propose countermeasures that ensure running times only dependent on the key size for the potentially vulnerable routines

Manger’s Attack revisited Falko Strenzke 28 / 1

slide-84
SLIDE 84

Conclusion

concerning the OpenSSL countermeasure, it is obvious that there is no common notion concerning the relevance of the leakage of “small” timing differences (compare with cache-timing attacks against AES, where minimal timing differences are regarded as critical) even though Manger’s Attack is known for almost 10 years, we could find new leakages about crucial properties of the message

in the MPI encoding routines in the MPI arithmetic (under certain circumstances)

we propose countermeasures that ensure running times only dependent on the key size for the potentially vulnerable routines

Manger’s Attack revisited Falko Strenzke 28 / 1

slide-85
SLIDE 85

Conclusion

concerning the OpenSSL countermeasure, it is obvious that there is no common notion concerning the relevance of the leakage of “small” timing differences (compare with cache-timing attacks against AES, where minimal timing differences are regarded as critical) even though Manger’s Attack is known for almost 10 years, we could find new leakages about crucial properties of the message

in the MPI encoding routines in the MPI arithmetic (under certain circumstances)

we propose countermeasures that ensure running times only dependent on the key size for the potentially vulnerable routines

Manger’s Attack revisited Falko Strenzke 28 / 1

slide-86
SLIDE 86

Thank You!

Manger’s Attack revisited Falko Strenzke 29 / 1