Hacker Public Radio

HPR3484: My vim setup with GnuPG


Listen Later

Using the GnuPG vim plugin to edit encrypted files.
See show hpr3476 My mutt email setup
http://www.hackerpublicradio.org/eps.php?id=3476
GnuPG Vim Plugin on vim.org
https://www.vim.org/scripts/script.php?script_id=3645
GnuPG Vim Plugin on Github
https://github.com/vim-scripts/gnupg.vim
From man 1 gpg-agent:
You should always add the following lines to your .bashrc or whatever initialization file is used for all shell invocations:
GPG_TTY=`tty`
export GPG_TTY
It is important that this environment variable always reflects the output of the tty command.
.bashrc snippet
## GPG Vim
GPG_TTY=`tty`
export GPG_TTY
export EDITOR=vim
GnuPG folder structure
[mark@fedora-lt ~]$ tree .vim
.vim
├── plugin
│ └── vim-gnupg
│ ├── autoload
│ │ └── gnupg.vim
│ ├── doc
│ │ └── gnupg.txt
│ ├── plugin
│ │ └── gnupg.vim
│ └── README.md
└── spell
├── en.utf-8.add
└── en.utf-8.add.spl
vimrc
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab textwidth=80
syntax on
autocmd BufRead,BufNewFile *.log set filetype=logtalk
set spell spelllang=en_us
Generate gpg full key
gpg --full-generate-key
or just a regular one, with less options
gpg --gen-key
Encrypt the file in question, with -r as the recipient
In this case, I used part of the comment as the recipient
Picture 1
Click the thumbnail to see the full-sized image
This is more like it.
gpg -e -r test thisIsMyTestFile.txt
Now test edit the file
vim thisIsMyTestFile.txt.gpg
Picture 2
It is a good idea to shred the original text file
shred - overwrite a file to hide its contents, and optionally delete it
-u deallocate and remove file after overwriting
-v, --verbose, show progress
...more
View all episodesView all episodes
Download on the App Store

Hacker Public RadioBy Hacker Public Radio

  • 4.2
  • 4.2
  • 4.2
  • 4.2
  • 4.2

4.2

34 ratings


More shows like Hacker Public Radio

View all
The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

290 Listeners

Defensive Security Podcast - Malware, Hacking, Cyber Security & Infosec by Jerry Bell and Andrew Kalat

Defensive Security Podcast - Malware, Hacking, Cyber Security & Infosec

372 Listeners

LINUX Unplugged by Jupiter Broadcasting

LINUX Unplugged

268 Listeners

SANS Internet Stormcenter Daily Cyber Security Podcast (Stormcast) by Johannes B. Ullrich

SANS Internet Stormcenter Daily Cyber Security Podcast (Stormcast)

651 Listeners

Curious Cases by BBC Radio 4

Curious Cases

821 Listeners

The Strong Towns Podcast by Strong Towns

The Strong Towns Podcast

423 Listeners

Late Night Linux by The Late Night Linux Family

Late Night Linux

164 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,059 Listeners

Cybersecurity Today by Jim Love

Cybersecurity Today

179 Listeners

CISO Series Podcast by David Spark, Mike Johnson, and Andy Ellis

CISO Series Podcast

189 Listeners

TechCrunch Daily Crunch by TechCrunch

TechCrunch Daily Crunch

42 Listeners

Strict Scrutiny by Crooked Media

Strict Scrutiny

5,800 Listeners

2.5 Admins by The Late Night Linux Family

2.5 Admins

98 Listeners

Cyber Security Headlines by CISO Series

Cyber Security Headlines

139 Listeners

What the Hack? by DeleteMe

What the Hack?

228 Listeners