diff --git a/src/vtestream-file.h b/src/vtestream-file.h
index 55d0685..0ac8465 100644
--- a/src/vtestream-file.h
+++ b/src/vtestream-file.h
@@ -81,17 +81,24 @@
 #include <string.h>
 #include <unistd.h>
 #include <zlib.h>
-#include <gnutls/gnutls.h>
-#include <gnutls/crypto.h>
+
+#ifdef VTE_ENCRYPT
+# include <gnutls/gnutls.h>
+# include <gnutls/crypto.h>
+#endif
 
 #include "vteutils.h"
 
+#ifdef VTE_ENCRYPT
 /* Currently the code requires that a stream cipher (e.g. GCM) is used
  * which can encrypt any amount of data without need for padding. */
-#define VTE_CIPHER_ALGORITHM    GNUTLS_CIPHER_AES_256_GCM
-#define VTE_CIPHER_KEY_SIZE     32
-#define VTE_CIPHER_IV_SIZE      12
-#define VTE_CIPHER_TAG_SIZE     16
+# define VTE_CIPHER_ALGORITHM    GNUTLS_CIPHER_AES_256_GCM
+# define VTE_CIPHER_KEY_SIZE     32
+# define VTE_CIPHER_IV_SIZE      12
+# define VTE_CIPHER_TAG_SIZE     16
+#else
+# define VTE_CIPHER_TAG_SIZE     0
+#endif
 
 #ifndef VTESTREAM_MAIN
 # define VTE_SNAKE_BLOCKSIZE 65536
@@ -610,6 +617,7 @@ typedef struct _VteBoa {
         VteSnake parent;
         gsize tail, head;
 
+#if !defined VTESTREAM_MAIN && defined VTE_ENCRYPT
         gnutls_cipher_hd_t cipher_hd;
         /* The IV (nonce) consists of the offset within the stream, and an overwrite counter so that
          * we don't reuse the same IVs when a block at a certain logical offset is overwritten.
@@ -621,6 +629,7 @@ typedef struct _VteBoa {
                 guint32 overwrite_counter;
                 unsigned char padding[VTE_CIPHER_IV_SIZE];
         } iv;
+#endif
         int compressBound;
 } VteBoa;
 
@@ -650,11 +659,13 @@ static void
 _vte_boa_encrypt (VteBoa *boa, gsize offset, guint32 overwrite_counter, char *data, unsigned int len)
 {
 #ifndef VTESTREAM_MAIN
+# ifdef VTE_ENCRYPT
         boa->iv.offset = offset;
         boa->iv.overwrite_counter = overwrite_counter;
         gnutls_cipher_set_iv (boa->cipher_hd, &boa->iv, VTE_CIPHER_IV_SIZE);
         gnutls_cipher_encrypt (boa->cipher_hd, data, len);
         gnutls_cipher_tag (boa->cipher_hd, data + len, VTE_CIPHER_TAG_SIZE);
+# endif
 #else
         /* Fake encryption for unit testing: uppercase <-> lowercase, followed by verification tag which is
          * 5 bits: block sequence number (offset divided by blocksize)
@@ -679,11 +690,13 @@ _vte_boa_decrypt (VteBoa *boa, gsize offset, guint32 overwrite_counter, char *da
         guint8 faulty = 0;
 
 #ifndef VTESTREAM_MAIN
+# ifdef VTE_ENCRYPT
         boa->iv.offset = offset;
         boa->iv.overwrite_counter = overwrite_counter;
         gnutls_cipher_set_iv (boa->cipher_hd, &boa->iv, VTE_CIPHER_IV_SIZE);
         gnutls_cipher_decrypt (boa->cipher_hd, data, len);
         gnutls_cipher_tag (boa->cipher_hd, tag, VTE_CIPHER_TAG_SIZE);
+# endif
 #else
         /* Fake decryption for unit testing; see above. */
         for (i = 0; i < len; i++) {
@@ -782,7 +795,7 @@ _vte_boa_uncompress (char *dst, unsigned int dstlen, const char *src, unsigned i
 static void
 _vte_boa_init (VteBoa *boa)
 {
-#ifndef VTESTREAM_MAIN
+#if !defined VTESTREAM_MAIN && defined VTE_ENCRYPT
         unsigned char key[VTE_CIPHER_KEY_SIZE];
         gnutls_datum_t datum_key;
 
@@ -815,11 +828,11 @@ _vte_boa_init (VteBoa *boa)
 static void
 _vte_boa_finalize (GObject *object)
 {
+#if !defined VTESTREAM_MAIN && defined VTE_ENCRYPT
         VteBoa *boa = (VteBoa *) object;
 
         memset(&boa->iv, 0, sizeof(boa->iv));
 
-#ifndef VTESTREAM_MAIN
         gnutls_cipher_deinit (boa->cipher_hd);
         gnutls_global_deinit ();
 #endif
