dm-crypt 를 이용한 Disk Encryption
0. introduction
- dm-crypt
- Device-Mapper's crypt
- Transparent disk encryption subsystem in Linux kernel versions 2.6 and later
- losetup
- set up and control loop devices
- package in Ubuntu
$ dpkg -S /sbin/losetup
mount: /sbin/losetup
- cryptsetup
- setup cryptographic volumes for dm-crypt (including LUKS extension)
- package in Ubuntu
$ dpkg -S /sbin/cryptsetup
cryptsetup-bin: /sbin/cryptsetup
1. 준비
- Ubuntu 12.04 64bit에서 테스트 진행
- $ qemu-img create -f raw dm.img 3G
2. Encrypt Disk 생성 및 포멧
- $ sudo losetup /dev/loop0 dm.img
- $ sudo cryptsetup create encrypt-fs /dev/loop0
Enter passphrase : testpwd
- $ ls -al /dev/mapper
encrypt-fs -> ../dm-0
- $ sudo mkfs.ext4 /dev/mapper/encrypt-fs
3. Encrypt Disk 제거
- $ sudo cryptsetup remove encrypt-fs
- $ sudo losetup -d /dev/loop0
4. Encrypt Disk Mount
- $ sudo losetup /dev/loop0 dm.img
- $ sudo cryptsetup create encrypt-fs /dev/loop0
Enter passphrase : testpwd
- $ mkdir mount
- $ sudo mount /dev/mapper/encrypt-fs ./mount
- $ ls a
lost+found
5. Encrypt Disk Unmount 및 제거
- $ sudo umount ./mount
- $ sudo cryptsetup remove encrypt-fs
- $ sudo losetup -d /dev/loop0
댓글
댓글 쓰기