gitbls / sdm

Raspberry Pi SD Card Image Manager
MIT License
469 stars 48 forks source link

Change cryptsetup encryption to aes cbc #194

Closed jollycar closed 7 months ago

jollycar commented 7 months ago

The Raspberry Pi 5 includes AES acceleration (AES-256-CBC). This is much faster than xchacha20,aes-adiantum-plain64

#            Algorithm |       Key |      Encryption |      Decryption
xchacha20,aes-adiantum        256b       398.9 MiB/s       418.8 MiB/s
               aes-cbc        256b       886.1 MiB/s      1848.6 MiB/s

I have tested these changes on my raspberryi pi 5 and works like a charm. Thanks for sdm.

Sources: https://www.hackster.io/news/raspberry-pi-5-review-hands-on-with-the-most-powerful-raspberry-pi-yet-57efaf61b10f https://www.raspberrypi.com/news/introducing-raspberry-pi-5/ https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-5

gitbls commented 7 months ago

Thx for pointing this out. While aes works well on the Pi5, it sucks wind on the Pi4. So, will be incorporating your changes with aes as the default and a switch for using xchacha.