mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-05 19:06:37 +02:00
📝 docs(_add): guide to generate gpg keys
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "dev_guide/gpg_key",
|
||||
"title": "Generate GPG Key",
|
||||
"description": "",
|
||||
"description": "🔐 How to Generate a GPG Key on Snigdha OS",
|
||||
"source": "@site/docs/dev_guide/gpg_key.md",
|
||||
"sourceDirName": "dev_guide",
|
||||
"slug": "/dev_guide/gpg_key",
|
||||
|
@@ -22,6 +22,6 @@
|
||||
},
|
||||
"next": {
|
||||
"title": "Coding Standard",
|
||||
"permalink": "/documentation/introduction/coding_standard"
|
||||
"permalink": "/documentation/introduction/coding-standard"
|
||||
}
|
||||
}
|
@@ -67,8 +67,8 @@
|
||||
{
|
||||
"type": "link",
|
||||
"label": "Coding Standard",
|
||||
"href": "/documentation/introduction/coding_standard",
|
||||
"docId": "introduction/coding_standard",
|
||||
"href": "/documentation/introduction/coding-standard",
|
||||
"docId": "introduction/coding-standard",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
@@ -392,7 +392,7 @@
|
||||
"dev_guide/gpg_key": {
|
||||
"id": "dev_guide/gpg_key",
|
||||
"title": "Generate GPG Key",
|
||||
"description": "",
|
||||
"description": "🔐 How to Generate a GPG Key on Snigdha OS",
|
||||
"sidebar": "tutorialSidebar"
|
||||
},
|
||||
"dev_guide/install_keyring": {
|
||||
@@ -461,8 +461,8 @@
|
||||
"description": "A code of conduct outlines expected behavior and guidelines for individuals within a specific community, organization, or group.",
|
||||
"sidebar": "tutorialSidebar"
|
||||
},
|
||||
"introduction/coding_standard": {
|
||||
"id": "introduction/coding_standard",
|
||||
"introduction/coding-standard": {
|
||||
"id": "introduction/coding-standard",
|
||||
"title": "Coding Standard",
|
||||
"description": "1. Consistent Naming Conventions:",
|
||||
"sidebar": "tutorialSidebar"
|
||||
|
@@ -157,7 +157,7 @@
|
||||
{
|
||||
"id": "dev_guide/gpg_key",
|
||||
"title": "Generate GPG Key",
|
||||
"description": "",
|
||||
"description": "🔐 How to Generate a GPG Key on Snigdha OS",
|
||||
"source": "@site/docs/dev_guide/gpg_key.md",
|
||||
"sourceDirName": "dev_guide",
|
||||
"slug": "/dev_guide/gpg_key",
|
||||
@@ -479,16 +479,16 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "introduction/coding_standard",
|
||||
"id": "introduction/coding-standard",
|
||||
"title": "Coding Standard",
|
||||
"description": "1. Consistent Naming Conventions:",
|
||||
"source": "@site/docs/introduction/coding_standard.md",
|
||||
"source": "@site/docs/introduction/coding-standard.md",
|
||||
"sourceDirName": "introduction",
|
||||
"slug": "/introduction/coding_standard",
|
||||
"permalink": "/documentation/introduction/coding_standard",
|
||||
"slug": "/introduction/coding-standard",
|
||||
"permalink": "/documentation/introduction/coding-standard",
|
||||
"draft": false,
|
||||
"unlisted": false,
|
||||
"editUrl": "https://github.com/Snigdha-OS/documentation/tree/master/docs/introduction/coding_standard.md",
|
||||
"editUrl": "https://github.com/Snigdha-OS/documentation/tree/master/docs/introduction/coding-standard.md",
|
||||
"tags": [],
|
||||
"version": "current",
|
||||
"sidebarPosition": 8,
|
||||
@@ -529,7 +529,7 @@
|
||||
},
|
||||
"next": {
|
||||
"title": "Coding Standard",
|
||||
"permalink": "/documentation/introduction/coding_standard"
|
||||
"permalink": "/documentation/introduction/coding-standard"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -579,7 +579,7 @@
|
||||
"sidebar": "tutorialSidebar",
|
||||
"previous": {
|
||||
"title": "Coding Standard",
|
||||
"permalink": "/documentation/introduction/coding_standard"
|
||||
"permalink": "/documentation/introduction/coding-standard"
|
||||
},
|
||||
"next": {
|
||||
"title": "Before Installation",
|
||||
@@ -1082,7 +1082,7 @@
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "introduction/coding_standard"
|
||||
"id": "introduction/coding-standard"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
|
@@ -96,8 +96,8 @@
|
||||
"sidebar": "tutorialSidebar"
|
||||
},
|
||||
{
|
||||
"id": "introduction/coding_standard",
|
||||
"path": "/documentation/introduction/coding_standard",
|
||||
"id": "introduction/coding-standard",
|
||||
"path": "/documentation/introduction/coding-standard",
|
||||
"sidebar": "tutorialSidebar"
|
||||
},
|
||||
{
|
||||
|
@@ -27,6 +27,7 @@ export default {
|
||||
"categoryGeneratedIndex---documentation-category-tools-96-b-75a": [() => import(/* webpackChunkName: "categoryGeneratedIndex---documentation-category-tools-96-b-75a" */ "~docs/default/category-documentation-tutorialsidebar-category-tools-82a.json"), "~docs/default/category-documentation-tutorialsidebar-category-tools-82a.json", require.resolveWeak("~docs/default/category-documentation-tutorialsidebar-category-tools-82a.json")],
|
||||
"categoryGeneratedIndex---documentation-category-troubleshootde-6-666": [() => import(/* webpackChunkName: "categoryGeneratedIndex---documentation-category-troubleshootde-6-666" */ "~docs/default/category-documentation-tutorialsidebar-category-troubleshoot-a4b.json"), "~docs/default/category-documentation-tutorialsidebar-category-troubleshoot-a4b.json", require.resolveWeak("~docs/default/category-documentation-tutorialsidebar-category-troubleshoot-a4b.json")],
|
||||
"categoryGeneratedIndex---documentation-category-user-guide-698-266": [() => import(/* webpackChunkName: "categoryGeneratedIndex---documentation-category-user-guide-698-266" */ "~docs/default/category-documentation-tutorialsidebar-category-user-guide-b31.json"), "~docs/default/category-documentation-tutorialsidebar-category-user-guide-b31.json", require.resolveWeak("~docs/default/category-documentation-tutorialsidebar-category-user-guide-b31.json")],
|
||||
"content---documentation-761-cec": [() => import(/* webpackChunkName: "content---documentation-761-cec" */ "@site/docs/introduction/overview.md"), "@site/docs/introduction/overview.md", require.resolveWeak("@site/docs/introduction/overview.md")],
|
||||
"content---documentation-before-installation-imporatnt-notesb-9-c-8d1": [() => import(/* webpackChunkName: "content---documentation-before-installation-imporatnt-notesb-9-c-8d1" */ "@site/docs/before_installation/imporatnt_notes.md"), "@site/docs/before_installation/imporatnt_notes.md", require.resolveWeak("@site/docs/before_installation/imporatnt_notes.md")],
|
||||
"content---documentation-before-installation-internet-connection-374-962": [() => import(/* webpackChunkName: "content---documentation-before-installation-internet-connection-374-962" */ "@site/docs/before_installation/internet_connection.md"), "@site/docs/before_installation/internet_connection.md", require.resolveWeak("@site/docs/before_installation/internet_connection.md")],
|
||||
"content---documentation-before-installation-system-requirements-143-bf9": [() => import(/* webpackChunkName: "content---documentation-before-installation-system-requirements-143-bf9" */ "@site/docs/before_installation/system_requirements.md"), "@site/docs/before_installation/system_requirements.md", require.resolveWeak("@site/docs/before_installation/system_requirements.md")],
|
||||
@@ -47,7 +48,7 @@ export default {
|
||||
"content---documentation-installation-start-installation-1-f-9-afb": [() => import(/* webpackChunkName: "content---documentation-installation-start-installation-1-f-9-afb" */ "@site/docs/installation/start_installation.md"), "@site/docs/installation/start_installation.md", require.resolveWeak("@site/docs/installation/start_installation.md")],
|
||||
"content---documentation-installation-virtualbox-installation-24-e-096": [() => import(/* webpackChunkName: "content---documentation-installation-virtualbox-installation-24-e-096" */ "@site/docs/installation/virtualbox_installation.md"), "@site/docs/installation/virtualbox_installation.md", require.resolveWeak("@site/docs/installation/virtualbox_installation.md")],
|
||||
"content---documentation-introduction-code-of-conducte-89-ce5": [() => import(/* webpackChunkName: "content---documentation-introduction-code-of-conducte-89-ce5" */ "@site/docs/introduction/code_of_conduct.md"), "@site/docs/introduction/code_of_conduct.md", require.resolveWeak("@site/docs/introduction/code_of_conduct.md")],
|
||||
"content---documentation-introduction-coding-standard-0-e-9-a35": [() => import(/* webpackChunkName: "content---documentation-introduction-coding-standard-0-e-9-a35" */ "@site/docs/introduction/coding_standard.md"), "@site/docs/introduction/coding_standard.md", require.resolveWeak("@site/docs/introduction/coding_standard.md")],
|
||||
"content---documentation-introduction-coding-standard-0-e-1-8f5": [() => import(/* webpackChunkName: "content---documentation-introduction-coding-standard-0-e-1-8f5" */ "@site/docs/introduction/coding-standard.md"), "@site/docs/introduction/coding-standard.md", require.resolveWeak("@site/docs/introduction/coding-standard.md")],
|
||||
"content---documentation-introduction-contributing-556-194": [() => import(/* webpackChunkName: "content---documentation-introduction-contributing-556-194" */ "@site/docs/introduction/contributing.md"), "@site/docs/introduction/contributing.md", require.resolveWeak("@site/docs/introduction/contributing.md")],
|
||||
"content---documentation-introduction-faqsb-19-00b": [() => import(/* webpackChunkName: "content---documentation-introduction-faqsb-19-00b" */ "@site/docs/introduction/faqs.md"), "@site/docs/introduction/faqs.md", require.resolveWeak("@site/docs/introduction/faqs.md")],
|
||||
"content---documentation-introduction-motivation-16-a-8e4": [() => import(/* webpackChunkName: "content---documentation-introduction-motivation-16-a-8e4" */ "@site/docs/introduction/motivation.md"), "@site/docs/introduction/motivation.md", require.resolveWeak("@site/docs/introduction/motivation.md")],
|
||||
@@ -55,7 +56,6 @@ export default {
|
||||
"content---documentation-introduction-release-notes-1-b-1-d2e": [() => import(/* webpackChunkName: "content---documentation-introduction-release-notes-1-b-1-d2e" */ "@site/docs/introduction/release_notes.md"), "@site/docs/introduction/release_notes.md", require.resolveWeak("@site/docs/introduction/release_notes.md")],
|
||||
"content---documentation-introduction-reporting-bugsdc-8-ae1": [() => import(/* webpackChunkName: "content---documentation-introduction-reporting-bugsdc-8-ae1" */ "@site/docs/introduction/reporting_bugs.md"), "@site/docs/introduction/reporting_bugs.md", require.resolveWeak("@site/docs/introduction/reporting_bugs.md")],
|
||||
"content---documentation-markdown-page-393-bce": [() => import(/* webpackChunkName: "content---documentation-markdown-page-393-bce" */ "@site/src/pages/markdown-page.md"), "@site/src/pages/markdown-page.md", require.resolveWeak("@site/src/pages/markdown-page.md")],
|
||||
"content---documentation-overview-761-225": [() => import(/* webpackChunkName: "content---documentation-overview-761-225" */ "@site/docs/introduction/overview.md"), "@site/docs/introduction/overview.md", require.resolveWeak("@site/docs/introduction/overview.md")],
|
||||
"content---documentation-packages-snigdhaos-blackboxbbd-050": [() => import(/* webpackChunkName: "content---documentation-packages-snigdhaos-blackboxbbd-050" */ "@site/docs/packages/snigdhaos_blackbox.md"), "@site/docs/packages/snigdhaos_blackbox.md", require.resolveWeak("@site/docs/packages/snigdhaos_blackbox.md")],
|
||||
"content---documentation-packages-snigdhaos-welcome-400-dfa": [() => import(/* webpackChunkName: "content---documentation-packages-snigdhaos-welcome-400-dfa" */ "@site/docs/packages/snigdhaos_welcome.md"), "@site/docs/packages/snigdhaos_welcome.md", require.resolveWeak("@site/docs/packages/snigdhaos_welcome.md")],
|
||||
"content---documentation-post-installation-customization-9-cb-3c6": [() => import(/* webpackChunkName: "content---documentation-post-installation-customization-9-cb-3c6" */ "@site/docs/post_installation/customization.md"), "@site/docs/post_installation/customization.md", require.resolveWeak("@site/docs/post_installation/customization.md")],
|
||||
|
@@ -79,15 +79,15 @@ export default [
|
||||
},
|
||||
{
|
||||
path: '/documentation/',
|
||||
component: ComponentCreator('/documentation/', '6b9'),
|
||||
component: ComponentCreator('/documentation/', 'f13'),
|
||||
routes: [
|
||||
{
|
||||
path: '/documentation/',
|
||||
component: ComponentCreator('/documentation/', 'ace'),
|
||||
component: ComponentCreator('/documentation/', '7bb'),
|
||||
routes: [
|
||||
{
|
||||
path: '/documentation/',
|
||||
component: ComponentCreator('/documentation/', '076'),
|
||||
component: ComponentCreator('/documentation/', 'b4c'),
|
||||
routes: [
|
||||
{
|
||||
path: '/documentation/before_installation/imporatnt_notes',
|
||||
@@ -246,8 +246,8 @@ export default [
|
||||
sidebar: "tutorialSidebar"
|
||||
},
|
||||
{
|
||||
path: '/documentation/introduction/coding_standard',
|
||||
component: ComponentCreator('/documentation/introduction/coding_standard', '14f'),
|
||||
path: '/documentation/introduction/coding-standard',
|
||||
component: ComponentCreator('/documentation/introduction/coding-standard', '105'),
|
||||
exact: true,
|
||||
sidebar: "tutorialSidebar"
|
||||
},
|
||||
|
@@ -113,17 +113,17 @@
|
||||
},
|
||||
"content": "content---documentation-privacy-policyfbb-0dc"
|
||||
},
|
||||
"/documentation/-6b9": {
|
||||
"/documentation/-f13": {
|
||||
"__comp": "__comp---theme-docs-root-5-e-9-0b6",
|
||||
"__context": {
|
||||
"plugin": "plugin---documentation-ed-9-690"
|
||||
}
|
||||
},
|
||||
"/documentation/-ace": {
|
||||
"/documentation/-7bb": {
|
||||
"__comp": "__comp---theme-doc-version-roota-7-b-5de",
|
||||
"version": "version---documentation-935-548"
|
||||
},
|
||||
"/documentation/-076": {
|
||||
"/documentation/-b4c": {
|
||||
"__comp": "__comp---theme-doc-roota-94-67a"
|
||||
},
|
||||
"/documentation/before_installation/imporatnt_notes-89a": {
|
||||
@@ -230,9 +230,9 @@
|
||||
"__comp": "__comp---theme-doc-item-178-a40",
|
||||
"content": "content---documentation-introduction-code-of-conducte-89-ce5"
|
||||
},
|
||||
"/documentation/introduction/coding_standard-14f": {
|
||||
"/documentation/introduction/coding-standard-105": {
|
||||
"__comp": "__comp---theme-doc-item-178-a40",
|
||||
"content": "content---documentation-introduction-coding-standard-0-e-9-a35"
|
||||
"content": "content---documentation-introduction-coding-standard-0-e-1-8f5"
|
||||
},
|
||||
"/documentation/introduction/contributing-2c1": {
|
||||
"__comp": "__comp---theme-doc-item-178-a40",
|
||||
@@ -312,6 +312,6 @@
|
||||
},
|
||||
"/documentation/-dd9": {
|
||||
"__comp": "__comp---theme-doc-item-178-a40",
|
||||
"content": "content---documentation-overview-761-225"
|
||||
"content": "content---documentation-761-cec"
|
||||
}
|
||||
}
|
@@ -2,3 +2,179 @@
|
||||
sidebar_position: 3
|
||||
---
|
||||
# Generate GPG Key
|
||||
### 🔐 How to Generate a GPG Key on Snigdha OS
|
||||
|
||||
GPG (GNU Privacy Guard) is a tool for secure communication and data encryption. It allows you to create and manage public and private keys, encrypt files, and sign documents. Here’s how you can generate a GPG key on Snigdha OS, step by step, with examples.
|
||||
|
||||
---
|
||||
|
||||
### 🛠️ Step 1: Install GPG
|
||||
|
||||
Most Snigdha OS installations come with GPG pre-installed. If it’s not installed, use the following command to install it:
|
||||
|
||||
```bash
|
||||
sudo pacman -S gnupg
|
||||
```
|
||||
|
||||
To verify the installation, check the version:
|
||||
|
||||
```bash
|
||||
gpg --version
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🛠️ Step 2: Create a New GPG Key Pair
|
||||
|
||||
1. **Start the key generation process**:
|
||||
|
||||
Run the following command:
|
||||
|
||||
```bash
|
||||
gpg --full-generate-key
|
||||
```
|
||||
|
||||
2. **Select the key type**:
|
||||
|
||||
You’ll see a prompt to choose the type of key. Options typically include:
|
||||
- **(1) RSA and RSA (default)**
|
||||
- (2) DSA and Elgamal
|
||||
- (3) DSA (sign only)
|
||||
- (4) RSA (sign only)
|
||||
|
||||
Press `1` and hit Enter to select the default **RSA and RSA** type.
|
||||
|
||||
3. **Set the key length**:
|
||||
|
||||
You’ll be prompted to specify the key size. A common recommendation is **4096 bits** for strong encryption. Type `4096` and press Enter.
|
||||
|
||||
4. **Set the expiration date**:
|
||||
|
||||
You can define how long the key should be valid. Options include:
|
||||
- `0` for no expiration
|
||||
- Specify a duration, e.g., `1y` for one year, `2y` for two years, or `1m` for one month.
|
||||
|
||||
For this example, type `0` (no expiration) and press Enter. When prompted, confirm your choice.
|
||||
|
||||
5. **Enter your details**:
|
||||
|
||||
You’ll be asked for:
|
||||
- **Your real name**: Enter your full name.
|
||||
- **Your email address**: Enter a valid email address.
|
||||
- **A comment (optional)**: Add a description or leave it blank.
|
||||
|
||||
Example:
|
||||
```
|
||||
Real name: John Doe
|
||||
Email address: johndoe@example.com
|
||||
Comment: Snigdha OS User
|
||||
```
|
||||
|
||||
Review the details and confirm by typing `O` (for OK).
|
||||
|
||||
6. **Set a passphrase**:
|
||||
|
||||
Choose a strong passphrase to protect your private key. This passphrase will be required whenever you use your private key for encryption or signing.
|
||||
|
||||
---
|
||||
|
||||
### 🛠️ Step 3: Verify the Generated Key
|
||||
|
||||
Once the key is generated, you can list your keys with:
|
||||
|
||||
```bash
|
||||
gpg --list-keys
|
||||
```
|
||||
|
||||
Output:
|
||||
```
|
||||
/home/username/.gnupg/pubring.kbx
|
||||
---------------------------------
|
||||
pub rsa4096 2023-12-05 [SC] [expires: 2025-12-05]
|
||||
ABCD1234EFGH5678IJKL9012MNOP3456QRST7890
|
||||
uid [ultimate] John Doe <johndoe@example.com>
|
||||
sub rsa4096 2023-12-05 [E] [expires: 2025-12-05]
|
||||
```
|
||||
|
||||
- **pub**: Your primary key (for signing and certification).
|
||||
- **sub**: Subkey (for encryption).
|
||||
- **[SC]**: Key capabilities: Sign and Certify.
|
||||
- **[E]**: Encryption.
|
||||
|
||||
---
|
||||
|
||||
### 🛠️ Step 4: Export Your Public Key
|
||||
|
||||
To share your public key with others, export it:
|
||||
|
||||
```bash
|
||||
gpg --armor --export johndoe@example.com > public_key.asc
|
||||
```
|
||||
|
||||
This creates a file `public_key.asc` with your public key in ASCII format.
|
||||
|
||||
To display the key in the terminal:
|
||||
|
||||
```bash
|
||||
gpg --armor --export johndoe@example.com
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🛠️ Step 5: Test Encryption and Decryption
|
||||
|
||||
1. **Encrypt a file**:
|
||||
|
||||
Create a sample file to encrypt:
|
||||
|
||||
```bash
|
||||
echo "Hello, this is a test message!" > message.txt
|
||||
```
|
||||
|
||||
Encrypt the file with your public key:
|
||||
|
||||
```bash
|
||||
gpg --output message.txt.gpg --encrypt --recipient johndoe@example.com message.txt
|
||||
```
|
||||
|
||||
This generates an encrypted file `message.txt.gpg`.
|
||||
|
||||
2. **Decrypt the file**:
|
||||
|
||||
Decrypt the file using your private key:
|
||||
|
||||
```bash
|
||||
gpg --output decrypted_message.txt --decrypt message.txt.gpg
|
||||
```
|
||||
|
||||
Enter your passphrase when prompted. The decrypted content will be saved in `decrypted_message.txt`.
|
||||
|
||||
---
|
||||
|
||||
### 🛠️ Step 6: Back Up Your Keys
|
||||
|
||||
Always back up your keys to prevent losing access:
|
||||
|
||||
1. **Export your private key**:
|
||||
|
||||
```bash
|
||||
gpg --armor --export-secret-keys johndoe@example.com > private_key.asc
|
||||
```
|
||||
|
||||
2. **Export your public key**:
|
||||
|
||||
```bash
|
||||
gpg --armor --export johndoe@example.com > public_key.asc
|
||||
```
|
||||
|
||||
3. Store these files (`private_key.asc` and `public_key.asc`) in a safe place.
|
||||
|
||||
---
|
||||
|
||||
### 🚀 Final Tips
|
||||
|
||||
- Keep your private key secure. Never share it.
|
||||
- Regularly update your passphrase for added security.
|
||||
- Use tools like **gpg-agent** for easier key management.
|
||||
|
||||
That’s it! You now have a functional GPG key pair set up on Snigdha OS. 🎉
|
Reference in New Issue
Block a user