# Scenario for applying power analysis

I have started doing some reading about power analysis (SPA, DPA), and it is not clear to me in what Scenario one would have to fear such an attack. It appears to me that a typical situation is

• Scenario A: A key is stored in plain text on a smart card, the analysis is conducted while encryption/decryption request are sent to the card and in effect the key is obtained.

However I am more interested in

• Scenario B: A key is stored encrypted on a device (smart card?). During normal operation one would send the passphrase (required for decrypting the key) together with an encryption/decryption request to be performed by the decrypted key. Now the assumption is that an attacker does not posses the passphrase.

Would it still be possible to obtain the passphrase by power analysis? (From my imagination the only thing one could do is feeding wrong passphrases.) From my understanding scenario B is not susceptible to power analysis, or am I wrong?

• The passphrase is usually called PIN and when checking if the correct one was sent to the card, the following SPA-based attack has to be prevented: If you check digit by digit and stop as soon you find a wrong digit, the attacker sees how many digits (s)he already guessed wrong. This reduces the number of tries required from $s^n$ to $s\cdot n$ (worst case if $s$ is the size of the alphabeth and $n$ its length). Therefore often the PIN is stored encrypted and the given value is encrypted before comparison, so DPA applies to this encryption (with less interesting key). – j.p. Jul 30 '17 at 6:51