# How to optimise encryption of backups?

**URL:** <https://forum.virtualmin.com/t/how-to-optimise-encryption-of-backups/135757>\
**Category:** Virtualmin\
**Tags:** solved\
**Created:** [November 9, 2025, 3:03pm UTC](https://forum.virtualmin.com/t/how-to-optimise-encryption-of-backups/135757 "2025-11-09T15:03:27Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [November 11, 2025, 6:48pm UTC](https://forum.virtualmin.com/t/how-to-optimise-encryption-of-backups/135757/5 "2025-11-11T18:48:18Z")

</div>

@Jamie, there is an issue with our `backup_encryption_command` because, by default, GPG compresses data before encrypting it in a single-threaded process. We are essentially doing this twice, so we should fix it by adding the `--compress-algo none` flag.

Also, I don’t see why we use the `--sign` flag, which can be expensive since we never call `--verify`?

@vincen Find the `bkeys-lib.pl` file, replace the following function, restart Webmin, and try again:

```auto
sub backup_encryption_command
{
local ($key) = @_;
&foreign_require("webmin");
local @uinfo = getpwnam("root");
$ENV{'HOME'} = $uinfo[7];	# In case HOME was reset by another module
return $webmin::gpgpath.
       (&gpg_supports_no_tty() ? " --no-tty" : "")." --encrypt".
       " --recipient ".quotemeta($key->{'key'}).
       " --default-key ".quotemeta($key->{'key'}).
       " --always-trust".
       " --cipher-algo AES256".
       " --compress-algo none";
}

```

---

_[View the full topic](https://forum.virtualmin.com/t/how-to-optimise-encryption-of-backups/135757)._
