dm-crypt.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. dm-crypt
  2. =========
  3. Device-Mapper's "crypt" target provides transparent encryption of block devices
  4. using the kernel crypto API.
  5. Parameters: <cipher> <key> <iv_offset> <device path> <offset>
  6. <cipher>
  7. Encryption cipher and an optional IV generation mode.
  8. (In format cipher-chainmode-ivopts:ivmode).
  9. Examples:
  10. des
  11. aes-cbc-essiv:sha256
  12. twofish-ecb
  13. /proc/crypto contains supported crypto modes
  14. <key>
  15. Key used for encryption. It is encoded as a hexadecimal number.
  16. You can only use key sizes that are valid for the selected cipher.
  17. <iv_offset>
  18. The IV offset is a sector count that is added to the sector number
  19. before creating the IV.
  20. <device path>
  21. This is the device that is going to be used as backend and contains the
  22. encrypted data. You can specify it as a path like /dev/xxx or a device
  23. number <major>:<minor>.
  24. <offset>
  25. Starting sector within the device where the encrypted data begins.
  26. Example scripts
  27. ===============
  28. LUKS (Linux Unified Key Setup) is now the preferred way to set up disk
  29. encryption with dm-crypt using the 'cryptsetup' utility, see
  30. http://luks.endorphin.org/
  31. [[
  32. #!/bin/sh
  33. # Create a crypt device using dmsetup
  34. dmsetup create crypt1 --table "0 `blockdev --getsize $1` crypt aes-cbc-essiv:sha256 babebabebabebabebabebabebabebabe 0 $1 0"
  35. ]]
  36. [[
  37. #!/bin/sh
  38. # Create a crypt device using cryptsetup and LUKS header with default cipher
  39. cryptsetup luksFormat $1
  40. cryptsetup luksOpen $1 crypt1
  41. ]]