# CheckoutChamp PGP Encryption Procedures

## Step 1: Generate API Key <a href="#checkoutchamppgpencryptionprocedures-step1-generateapikey" id="checkoutchamppgpencryptionprocedures-step1-generateapikey"></a>

```
gpg --full-generate-key
```

OR

```
gpg --default-new-key-algo rsa2048 --gen-key && gpg --full-generate-key

```

### **1a. Select (1) RSA and RSA**

* hit enter key

### **1b. Select 2048 as keysize**

* hit enter key

### **1c. Specify how long the key should be validd. Is this correct? (y/N):**

* type y

### **1e. Real Name:**

* type firstname lastname

### **1f. Email address:**

* type email address

### **1g. Comment:**

* type any comment

### **1h. Enter passphrase:**

* enter a phrase with non related words and remember it

### **1i. Repeat passphrase.**&#x20;

* Wait for the result by operating computer in various ways.k. On finish, you can see the user-id(uid) like “firstname lastname (comment) < email address >” You can also check “uid” with the command “gpg --list-key”Note: It will take some time to get the uid. Please be patient.

## Step 2: Create public key <a href="#checkoutchamppgpencryptionprocedures-step2-createpublickey" id="checkoutchamppgpencryptionprocedures-step2-createpublickey"></a>

```
gpg --list-keys --keyid-format=long    # view the key we just created
```

then

```
gpg --export -a "<user-name>" > public.key    # where uid is <user-name> / first name used
```

## Step 3: Create private key <a href="#checkoutchamppgpencryptionprocedures-step3-createprivatekey" id="checkoutchamppgpencryptionprocedures-step3-createprivatekey"></a>

```
gpg --export-secret-key -a "james" > private.key    # where uid is <user-name> / first name used
```

<br>

## Step 4: Encrypt a file <a href="#checkoutchamppgpencryptionprocedures-step4-encryptafile" id="checkoutchamppgpencryptionprocedures-step4-encryptafile"></a>

```
gpg --recipient <user-name> --output <output-file>.pgp --encrypt <input-file>.txt    # where uid is <user-name>
```

**Note: Generally, the file will be encrypted by Konnektive.**

## Step 5: Decrypt a file <a href="#checkoutchamppgpencryptionprocedures-step5-decryptafile" id="checkoutchamppgpencryptionprocedures-step5-decryptafile"></a>

```
gpg --output <output-file> --decrypt <input-file>    # then enter passphrase
```

\
\
**for ASCII armor → add the \`--armor\` flag**Extra Resources;<https://bitbucket.org/jameskoonts/workspace/snippets/Az64ER>
