File: enctest

package info (click to toggle)
zfs-autobackup 3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 616 kB
  • sloc: python: 5,044; sh: 94; makefile: 3
file content (33 lines) | stat: -rwxr-xr-x 611 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

#NOTE: usually the speed is the same, but the cpu usage is much higher for ccm

set -e

D=/enctest123
DS=rpool$D

echo sdflsakjfklsjfsda > key.txt

dd if=/dev/urandom of=dump.bin bs=1M count=10000

#readcache
cat dump.bin > /dev/null

zfs destroy $DS || true

zfs create $DS

echo Unencrypted:
sync
time ( cp dump.bin $D/dump.bin;  sync )


for E in aes-128-ccm aes-192-ccm aes-256-ccm aes-128-gcm aes-192-gcm aes-256-gcm; do
 zfs destroy $DS
 zfs create -o encryption=$E -o keylocation=file://`pwd`/key.txt -o keyformat=passphrase $DS
 echo $E
 sync
 time ( cp dump.bin $D/dump.bin;  sync )
done