Search code examples
gnupgsigningpgp

gpg: --sign, --clear-sign, --detach-sign


I am making this question because I didn't find a clear explanation about the difference between these 3 gpg options:

gpg --sign file        # produces file.gpg
gpg --clear-sign file  # produces file.asc
gpg --detach-sign file # produces file.sig

file.gpg and file.sig seem to be binary files, while file.asc seems to be a text file. What is the relationship between these 3 files?


Solution

  • Here you go: https://www.gnupg.org/gph/en/manual/x135.html

    Basically when signing with --detach-sign the resulting .sig won't contain the signed file only the signature.
    --sign compresses, signs and outputs the signed text in a binary format.
    --clearsign wraps the text in an ASCII-armored signature