According to my understanding of computational cryptology, the body of a signed document can be retrieved disregarding whether or not the signature is authentic. However, I cannot apply this practically:
Given a pair of RSA keys
public.pem, I have signed some data:
openssl rsautl -inkey private.pem -sign -out signed.dat -in clear.txt
I believe that
signed.data now has the contents of
clear.txt, a hash of those contents and the actual signature, which is basically a cyphertext of the hash using the provided key. Thus, one can verify the signature and recover the body of data. Concretely:
openssl rsautl -verify -inkey public.pem -in signed.dat -pubin
To which the contents of
clear.txt are output to
stdout, and the file
signed.dat can be considered to have an authentic signature. It is clear that to verify the signature,
public.pem must be used to reverse the cyphering of the hashing of the contents and compare this result with the clear version of the hash. However, the contents themselves should also be available to anyone without the public key. They should be somewhere in cleartext or some other uncyphered format in
How can one obtain the content of
signed.dat without any keys?
If I am wrong in my concepts of cryptology, I would also appreciate some clarification.