---
# System prepended metadata

title: GPG & SSH

---

# GPG & SSH

## GnuPG

### Creating A New Keypair 	 
```
gpg --gen-key 
```
Prompts for information and then creates an appropriate keypair

passphrase gpg(Jan): 9ZkLjZPeGFn2aqtM
passphrase gpg(Daniel): Sc4MHMzjgNakZ8GjehFZm7QMF6PEs8

![](https://i.imgur.com/w8FyUyw.png)

```
gpg --list-key
```
Lists all keys

### Exporting key to a server

```
gpg --send-keys --armor < Key-ID >
```

![](https://i.imgur.com/diiaU7v.png)

## Key import


Key ID(Weidinger): 769EE560
Key ID(Gruber): BEA51019

```
gpg --keyserver hkp://pool.sks-keyserver.net --recv-keys < Key-ID >
```

![](https://i.imgur.com/T2JRqan.png)

### Set trust level

```
gpg --edit-key Daniel Weidinger
```

![](https://i.imgur.com/PrtpArA.png)


```
trust
```

![](https://i.imgur.com/KfjzYDJ.png)


### Signing

```
gpg --output supersecret.sig --sign supersecret.txt
```

```
gpg --verify supersecret.sig
```

![](https://i.imgur.com/GKTXLuf.png)

### Encrypt

```
gpg --output supersecret.txt.gpg --encrypt 
--recipient daniel.weidinger@hp-weidinger.at supersecret.txt
```

### Decrypt

```
gpg --output supersecret.txt --decrypt supersecret.txt.gpg
```

### Symmectric Encrypt

Passphrase: dannydevito

```
gpg --output supersecretSymmetric.txt.gpg --symmetric supersecret.txt
```

## SSH

