From 7f468c3a9160a631f4b97ec69f65c61202636315 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 23 Jul 2021 17:32:42 -0400 Subject: [PATCH] Correct offset to be in sectors, not bytes --- imgutil/imgutil | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgutil/imgutil b/imgutil/imgutil index abf7021b..334c24d0 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -284,7 +284,7 @@ def encrypt_image(plainfile, cryptfile, keyfile): neededblocks += 1 loopdev = subprocess.check_output(['losetup', '-f']).decode('utf8').strip() subprocess.check_call(['losetup', loopdev, cryptfile]) - subprocess.check_call(['dmsetup', 'create', dmname, '--table', '0 {} crypt aes-xts-plain64 {} 0 {} 4096'.format(neededblocks, key, loopdev)]) + subprocess.check_call(['dmsetup', 'create', dmname, '--table', '0 {} crypt aes-xts-plain64 {} 0 {} 8'.format(neededblocks, key, loopdev)]) with open('/dev/mapper/{}'.format(dmname), 'wb') as cryptout: with open(plainfile, 'rb') as plainin: chunk = plainin.read(65536)