As the computing and storage capabilities of smartphones increase, mobile phones will store more and more private data, and the leakage of such data may cause serious consequences. Mobile phone information security has always been one of our key points. For some important functions, we need to authenticate them before they can be used. However, this can only block novice hackers, and it can only protect against gentlemen and prevent villains, therefore, we hope to encrypt important data before saving it. To this end, it took a moment to learn about the Linux disk encryption method.
Method 1:
Download and compile util-linuxhttp: // www.paranoiacs.org /~ Sluskyb/hacks/util-linux/losetup-combined.patchhttp: // ftp. cwi. nl/aeb/util-linux/util-linux-2.12.tar.gzhttp: // hydra.azilian.net/util-linux-2.12-kernel-2.6.patchtar zxvf util-linux-2.12.tar.gzcd util-linux-2.12patch-p1 <.. /losetup-combined.patchpatch-p1 <.. /util-linux-2.12-kernel-2.6.patch (if there are compilation errors such as _ syscall5, replace it with the new call method syscall) make; make install compile kernel (skip this step if cryptoloop is already supported) make menuconfigDevice Drivers > Block Devices> Loopback device supportBLK_DEV_CRYPTOLOOP loading module modprobe cryptoloop (and encryption module) create a loop device dd if =/dev/zero of = ~ /Cryptoloop. image bs = 1 M count = 10 losetup-e aes-256/dev/loop0 ~ /Cryptoloop. image (Prompt For Password Input) create a file system and load mkfs. ext3/dev/loop0mkdir/mnt/cryptomount-t ext3 ~ /Cryptoloop. image/mnt/crypto/-oencryption = aes-256 (prompted for a password) uninstall umount/mnt/cryptolosetup-d/dev/loop0 reload losetup-e aes-256/dev/loop0 ~ /Cryptoloop. imagemount-t ext3 ~ /Cryptoloop. image/mnt/crypto/-oencryption = aes-256 |
Cryptoloop is a transfer implementation. For which transfer and transfer parameters (such as passwords) are used, this can be done through the ioctrl System Call of LOOP_SET_STATUS64 (the mount command is implemented in this way ).
The disadvantage of cryptoloop is that it is only applicable to loop devices and does not work for log file systems.