This repository was archived by the owner on Apr 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
This repository was archived by the owner on Apr 20, 2025. It is now read-only.
Blinding uses slow algorithm #162
Copy link
Copy link
Closed
Description
The private key operations generate a new blinding factor for every new signature:
Lines 440 to 453 in 4beb68d
def blinded_encrypt(self, message: int) -> int: | |
"""Encrypts the message using blinding to prevent side-channel attacks. | |
:param message: the message to encrypt | |
:type message: int | |
:returns: the encrypted message | |
:rtype: int | |
""" | |
blind_r = self._get_blinding_factor() | |
blinded = self.blind(message, blind_r) # blind before encrypting | |
encrypted = rsa.core.encrypt_int(blinded, self.d, self.n) | |
return self.unblind(encrypted, blind_r) |
Given that blinding requires calculating inverse modulo of of the blinding factor, it is a slow operation (rule of thumb is that inverse is as costly as calculating 100 modulo multiplications).
The existing literature[1] (section 9) suggests generating a blinding factor, its inverse, and then squaring both of them for next operation.
Metadata
Metadata
Assignees
Labels
No labels