I've been given a set of message-signature pairs to decrypt using a public RSA key I set up. I need to sort through the decoded messages, and find which of those have a valid signature. My public key is
e=13
and
m=23988477718194197355263570318118557072073635564327068738051383543307247873821867
My code so far comprises of
decryptionRSA[x_?IntegerQ, d_?IntegerQ, m_?IntegerQ] := PowerMod[x, d, m];
SetAttributes[decryptionRSA, Listable]
messages2 = Table[i -> decryptionRSA[messages, d, m], {i, messages}]
It then outputs messages2
, which is too big to copy onto here. Note that: d=PowerMod[e,-1,m]
. A message signature pair will come in the form (a,b), with b being the signature. To tell if the pair is valid and authentic, using the public key, you compute z=PowerMod[b,e,m]
and if this equal to a then the pair is valid. However, I don't know how I would verify this with a large quantity of data, would I use the Table
function?