As part of rooting a device, I need to generate a 256-byte RSASSA-PSS signature using SHA256 as the hash and MGF1-SHA256 as the mask function, for an update file I created. I can choose any 32-byte key; moreover, I am provided with a default key, namely


However, I have no clue what those terms mean (e.g. mask function???). The rooting guide refers to a specification sheet online, that details how these encryption algorithms work. Would I have to follow all the steps in that file one by one, or has this algorithm already been programmed somewhere, in a way that I can provide the file and the key, and it can give me the 256-byte hash?

I apologize in advance if this is not the type of questions that are typically asked on the crypto site; but I asked on the meta, and did not get a response about where I can ask this; and, this is the last step of a day-long root, so I really wish to get this done.

  • $\begingroup$ RSASSA-PSS is indeed implemented quite often and finding an implementation shouldn't be all too hard. I don't know whether it is already implemented as "give me the file and the key and I give you the signature", but "give me something to sign (in memory) and the key and I give you the signature" certainly is implemented. $\endgroup$ – SEJPM May 22 '16 at 12:34
  • 3
    $\begingroup$ It seems to me that you've only got part of the public key. With just (part of) the public key you won't be able to create a signature. A 256 byte PSS signature indicates a 2048 bit private key. Your key ends however with 0203010001, which is the ASN.1 encoding of the fourth Fermat prime, which is often used as public exponent. The part before that is likely the last part of the modulus (also public). $\endgroup$ – Maarten Bodewes May 22 '16 at 12:34