Showing posts with label dd. Show all posts
Showing posts with label dd. Show all posts

21 July 2015

Data Security: Cryptsetup

Data Security: Cryptsetup

Data Security: Cryptsetup

Cryptsetup

according to the MAN page:
cryptsetup - manage plain dm-crypt and LUKS encrypted volumes

..cryptsetup is used to conveniently setup dm-crypt managed device-mapper mappings. These include plain dm-crypt volumes and LUKS volumes. The difference is that LUKS uses a metadata header and can hence offer more features than plain dm-crypt...




• Installing Cryptsetup:
sudo apt install cryptsetup


***SETUP***

• Creating a container:
dd if=/dev/urandom of=~/my_encrypted_drive.dd bs=1M count=256

• Format it:
sudo cryptsetup luksFormat ~/my_encrypted_drive.dd

• Opening it:
sudo cryptsetup luksOpen ~/my_encrypted_drive.dd my_drive
my_drive will appear in /dev/mapper/.

• Create a filesystem within it:
mkfs -t ext4 /dev/mapper/my_drive

• Mount the container:
sudo mount -t ext4 /dev/mapper/my_drive ~/mnt/


***Consequence run***

sudo cryptsetup luksOpen ~/my_encrypted_drive.dd my_drive
sudo mount -t ext4 /dev/mapper/my_drive~/mnt/


• Unmounting:
sudo umount ~/mnt/
sudo cryptsetup luksClose my_drive


• Changing Password/Passphrase:
sudo cryptsetup luksChangeKey my_encrypted_drive.dd

• for more usage and help:
cryptsetup --help
man cryptsetup

Read more at Cryptsetup Homepage and Wikipedia .


note:
device => my_encrypted_drive.dd


Disclaimer

04 July 2015

Unix tricks: Create a Portable Drive

Unix Tricks: Create a Portable Drive

Create a Portable Drive
unix tricks

Unix Tricks

• Create a blank file of 256 MB :
dd if=/dev/zero of=~/portable.drive bs=1M count=256

• Create an ext4  filesystem within the file:
mkfs -t ext4 ~/portable.drive
you can replace ext4 with ext2, ext3, vfat, msdos, minix etc.

• Create a mount point:
mkdir ~/mnt/

• Mount the File/Drive:
sudo mount -t ext4 ~/portable.drive ~/mnt/
  ••Now you can browse the drive••

• Unmount the drive:
sudo umount ~/mnt/

    Advantages
  • Easy to carry files stored in one container.
  • Good for hiding data and files from plain sight.if you share your computer with others
  • Usable across unix System.
    Disadvantages
  • No security or encryption set/applied.
  • Cannot be viewed, opened in Windows natively.


note:
The file created by this method can only be open and read by unix and unix-like system. Natively Windows cannot open this kind of file. but its possible to open it with Cywin
software.

letter-spacing:1px; letter-spacing:1px; Disclaimer