diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php
index 40cbc1c141a2f2a84a4578e48b8e3b93fcbf4d90..62b2ad9d9afa1f64c90e15fa9851f7d92f575d70 100644
--- a/lib/private/files/stream/encryption.php
+++ b/lib/private/files/stream/encryption.php
@@ -270,6 +270,7 @@ class Encryption extends Wrapper {
 
 		if ($this->position === 0) {
 			$this->writeHeader();
+			$this->size+=$this->util->getBlockSize();
 		}
 
 		$length = 0;