Cryptology ePrint Archive: Report 2020/855

Fooling primality tests on smartcards

Vladimir Sedlacek and Jan Jancar and Petr Svenda

Abstract: We analyse whether the smartcards of the JavaCard platform correctly validate primality of domain parameters. The work is inspired by the paper Prime and prejudice: primality testing under adversarial conditions, where the authors analysed many open-source libraries and constructed pseudoprimes fooling the primality testing functions. However, in the case of smartcards, often there is no way to invoke the primality test directly, so we trigger it by replacing (EC)DSA and (EC)DH prime domain parameters by adversarial composites. Such a replacement results in vulnerability to Pohlig-Hellman style attacks, leading to private key recovery.

Out of nine smartcards (produced by five major manufacturers) we tested, all but one have no primality test in parameter validation. As the JavaCard platform provides no public primality testing API, the problem cannot be fixed by an extra parameter check, %an additional check before the parameters are passed to existing (EC)DSA and (EC)DH functions, making it difficult to mitigate in already deployed smartcards.

Category / Keywords: implementation / pseudoprimes, primality testing, JavaCard, (EC)DSA, (EC)DH

Original Publication (in the same form): ESORICS 2020

Date: received 9 Jul 2020

Contact author: vlada sedlacek at mail muni cz

Available format(s): PDF | BibTeX Citation

Version: 20200712:124520 (All versions of this report)

Short URL: ia.cr/2020/855


[ Cryptology ePrint archive ]