# How to generate an RSASSA-PSS signature with MGF1-SHA256? [closed]

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

49db67e9a6f198be22b03e84dedd69b834ba67d42e017d2f1ef08f0203010001


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.

## closed as unclear what you're asking by Squeamish Ossifrage, Maeher, Maarten Bodewes♦Mar 17 at 1:33

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• 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. – SEJPM May 22 '16 at 12:34
• 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). – Maarten Bodewes May 22 '16 at 12:34