Securing Files

This is for Windows, better and more detailed guides are readily available for Linux

Using BitLocker to create an encrypted drive:

Here's a handy bat script (thanks in part to


SET VirtualDiskLocation="%CD%\Keys_Certs_and_Similar.vhd"

SET DiskPartScriptLocation="%TEMP%\DiskMountScript-%RANDOM%.txt"

ECHO SELECT VDISK FILE=%VirtualDiskLocation% > %DiskPartScriptLocation%

ECHO ATTACH VDISK >> %DiskPartScriptLocation%

echo select partition 1 >> %DiskPartScriptLocation%

echo assign letter=T >> %DiskPartScriptLocation%

DiskPart /s %DiskPartScriptLocation%

DEL %DiskPartScriptLocation%


Encrypting files with PGP:

Keep your private key safe. Share your public key everywhere!

Here's what an example of using gpg for asymmetric encryption looks like on Windows:

C:\temp\gpg>gpg --list-keys

gpg: C:/Users/boyce/AppData/Roaming/gnupg/trustdb.gpg: trustdb created

C:\temp\gpg>gpg --import anc-at-yah.gpg.public.key

gpg: key B88EB520: public key "Boyce Crownover (Expires 05May2026 Created 06May2016) <>" imported

gpg: Total number processed: 1

gpg:               imported: 1  (RSA: 1)

C:\temp\gpg>gpg --list-keys



pub   2048R/B88EB520 2016-05-06 [expires: 2026-05-04]

uid       [ unknown] Boyce Crownover (Expires 05May2026 Created 06May2016) <>

sub   2048R/B5CB7A58 2016-05-06 [expires: 2026-05-04]

C:\temp\gpg>gpg --encrypt --recipient 'Boyce Crownover' TextDocumentExample.txt

usage: gpg [options] --encrypt [filename]

C:\temp\gpg>gpg --encrypt --recipient "Boyce Crownover" TextDocumentExample.txt

gpg: B5CB7A58: There is no assurance this key belongs to the named user

sub  2048R/B5CB7A58 2016-05-06 Boyce Crownover (Expires 05May2026 Created 06May2016) <>

 Primary key fingerprint: FCA3 EC13 7808 D354 BE95  5534 7816 B522 B88E B520

      Subkey fingerprint: C175 DA12 A3DE B65F DC0E  71D9 1104 2CC3 B5CB 7A58

It is NOT certain that the key belongs to the person named

in the user ID.  If you *really* know what you are doing,

you may answer the next question with yes.

Use this key anyway? (y/N) y

C:\temp\gpg>gpg --decrypt TextDocumentExample.txt.gpg > Decrypted.TextDocumentExample.txt


 Directory of C:\temp\gpg

05/17/2016  12:01 PM    <DIR>          .

05/17/2016  12:01 PM    <DIR>          ..

05/06/2016  10:36 AM             3,702 anc-at-yah.gpg.private.key

05/06/2016  10:36 AM             1,806 anc-at-yah.gpg.public.key

05/17/2016  12:01 PM                33 Decrypted.TextDocumentExample.txt

05/17/2016  11:55 AM               376 TextDocumentExample.txt.gpg

05/17/2016  11:48 AM                 0 pubring.gpg

05/17/2016  11:48 AM                 0 pubring.gpg.lock

05/17/2016  11:48 AM                 0 secring.gpg

05/17/2016  11:48 AM                 0 secring.gpg.lock

05/17/2016  11:54 AM                33 TextDocumentExample.txt

               9 File(s)          5,950 bytes

               2 Dir(s)   1,020,076,032 bytes free