I have messages that will form a permanent record and be stored for a long time. I care about integrity, authentication, and non-repudiation, so I intend to have the clients creating those messages sign them with private keys prior to submitting them, so that their content and origin may be verified on submission and again at any point in the future. My plan is to have the clients hash the messages with SHA-256 and sign that hash using 2048-bit RSA private keys. The messages will be structured data with a fixed number of fields. (In case it matters, the present spec calls for each message to consist of three ASCII strings, two unsigned integers, and a timestamp.)

Is the guarantee conveyed by the message signature impacted by how the message is represented? To be more concrete, does it make a practical difference in how difficult it is to alter or forge a signed message if the message to be signed is in e.g. XML, or JSON, or DER, or just concatenated together with line breaks for separators?

1 Answer 1


Most solutions I have come across have chosen a XML-like structure where the 'plain text' have been one part and the signature have been an added section.


<message><various tags to represent your data></message>


<message><various tags to represent your data><signedhash></signedhash></message>

But to answer your question, I would say it would have little practical difference.

There are theoretical increased risk with any situation where you increase the predictability of your plain text before encryption where randomized padding was used for example to make sure all messages was exactly the same number of bytes.

If you put in known structure in your hash, it might take me a few decades less to brute-force a hash that matches correctly?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .