aboutsummaryrefslogtreecommitdiffstats
path: root/src/content/docs/guides/sign-verify-file.md
blob: 7693bf46b287057acec41ed80e700606b47146ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
title: Signing & Verifying Files
---

GpgFrontend extends its utility from handling text-based operations to
facilitating file operations with ease and security. The principle behind
signing and verifying files mirrors that of text, leveraging the robust
framework of digital signatures. However, a significant distinction lies in the
nature of the input and output for file operations, which can be binary,
accommodating a wider range of file types beyond simple text documents.

When signing a file using GpgFrontend, the software utilizes the private key of
the user to create a digital signature. This process begins by computing a hash
of the file's contents, regardless of whether the file is a document, image,
executable, or any other binary format. This hash serves as a compact
representation of the file's data. Subsequently, the hash is encrypted with the
user's private key, producing a digital signature unique to both the file and
the key used. The resulting signature can either be attached to the file or
stored separately, depending on the user's preference and the requirements of
the application.

Verifying a signed file with GpgFrontend involves the corresponding public key
of the private key that was used for signing. The verification process decrypts
the digital signature using this public key to extract the original hash value
that was generated during the signing. Simultaneously, the software computes a
new hash from the file that is purported to be authentic. By comparing these two
hash values, GpgFrontend can determine if the file has been altered after it was
signed. If the hashes match, it confirms the file's integrity and authenticity,
assuring the recipient of its untampered state and the signer's identity.

This binary capability of file operations in GpgFrontend not only broadens the
scope of digital signatures to encompass a variety of file types but also
ensures that the integrity and authenticity verification process is not limited
to text-based data. It provides a critical layer of security in digital
communications, where files of all kinds are shared and exchanged with the
expectation of privacy and trust.

The application of digital signatures to files through tools like GpgFrontend is
especially relevant in scenarios where the authenticity of the file source and
the integrity of its contents are paramount. This includes software
distribution, where verifying the source and integrity of software packages is
crucial to prevent malware distribution; document sharing in legal and financial
contexts, where tampering could have serious implications; and multimedia
content distribution, where copyright and ownership are significant concerns.

In summary, GpgFrontend's support for signing and verifying files elevates the
security of digital file exchanges by applying the principles of cryptography in
a user-friendly manner. By accommodating binary file operations, it ensures that
digital signatures are accessible and applicable across a broad spectrum of file
types, reinforcing the pillars of trust and security in digital communications.

## Sign & Verify File

GpgFrontend extends its utility from handling text-based operations to
facilitating file operations with ease and security. The principle behind
signing and verifying files mirrors that of text, leveraging the robust
framework of digital signatures. However, a significant distinction lies in the
nature of the input and output for file operations, which can be binary,
accommodating a wider range of file types beyond simple text documents.

## Using File Browser for Signing and Verifying

After clicking the **File Browser** button, a system directory selection dialog
will appear. Follow these steps to perform signing and verifying operations:

1. **Open File Browser**:

   - Click the **File Browser** button in the toolbar at the top of the
     interface. This will open a system dialog allowing you to choose a
     directory.

2. **Select Directory**:

   - In the system dialog, navigate to the desired directory and select it. Once
     selected, a new tab named "File Browser" will open in GpgFrontend,
     displaying the contents of the chosen directory.

3. **Select a File**:

   - In the File Browser tab, you will see a list of files and folders within
     the selected directory. Click on the file you want to sign or verify.

4. **Sign the File**:

   - To sign a file, first select the file in the File Browser. Then, in the
     **Key Toolbox** on the right, select your private key by checking the box
     next to your key. Finally, click the **Sign** button in the toolbar at the
     top.

5. **Verify the File**:

   - To verify a file, select the signed file in the File Browser. Ensure you
     have the corresponding public key in your keyring. Click the **Verify**
     button in the toolbar. If the correct key is available, the file's
     signature will be verified.

![File Operations](https://image.cdn.bktus.com/i/2024/06/15/e157e4ff-ddaa-3a24-1a6f-a3fb80a55661.webp)

By following these steps, you can easily manage file signing and verifying using
the GpgFrontend's File Browser feature. This streamlined process allows you to
handle your cryptographic needs directly from the file system interface.

## File Extension Requirements

GpgFrontend supports different file extensions for various cryptographic
operations. Understanding these extensions helps in properly managing signed
files. Here’s a breakdown of the file extensions used:

#### ASCII Format

- **.asc**: Files with the ".asc" extension are in ASCII format. These files
  contain ASCII-armored signatures, which are a text representation of the
  signed data. ASCII format is typically used for easy sharing via email or text
  editors, as it ensures compatibility with text-based applications.

#### Binary Format

- **.sig**: Files with the ".sig" extension are in binary format. Binary
  signature files are more compact than their ASCII counterparts and are
  generally used for more efficient storage and transmission. They cannot be
  viewed directly in text editors, as the content is in a binary format.
- **.gpg**: Files with the ".gpg" extension are also used for binary signatures.
  These files are used when both encryption and signing are performed together,
  containing both the encrypted content and the signature.

To perform verification operations, you need to use files with either the
".sig", ".gpg", or ".asc" extension. These files contain the necessary signature
content required for these operations.

By adhering to these file extension requirements, you can ensure that your
signed files are correctly recognized and processed by GpgFrontend.

### Default Output Mode

Before version 2.0.4, GpgFrontend generated signature files exclusively in ASCII
format. However, beginning with version 2.0.4, GpgFrontend now generates
signature files in binary format by default. This setting can be adjusted in the
program's settings.

### Changing Output Mode

To change the output mode between ASCII and binary formats, follow these steps:

1. **Open Settings**:

   - Navigate to the GnuPG Controller settings within GpgFrontend. This can be
     done by accessing the settings menu from the main interface.

2. **Locate Binary Mode Option**:

   - In the settings interface, under the "General" section, locate the option
     labeled "Use Binary Mode for File Operations".

3. **Toggle Binary Mode**:
   - Check or uncheck this option to switch between binary (sig/gpg) and ASCII
     (asc) output formats. Checking the box will enable binary mode, while
     unchecking it will revert to ASCII format.

By following these steps, you can customize how GpgFrontend handles the format
of signature files according to your preference or needs.

![Locate Binary Mode
Option](https://image.cdn.bktus.com/i/2024/06/15/1a82922d-4a68-d315-f388-5571a4d93e8f.webp)