Showing posts with label security. Show all posts
Showing posts with label security. 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

15 July 2015

Data Security: EncFS

Data Security: EncFS

ENCFS

according to the MAN page:

encfs - mounts or creates an encrypted virtual filesystem

..EncFS creates a virtual encrypted filesystem which stores encrypted data in the rootdir directory and makes the unencrypted data visible at the mountPoint directory. The user must supply a password which is used to (indirectly) encrypt both filenames and file contents...

    Advantages of EncFS:
  • Does not require root privilages.
  • Easy, simple to setup and carry.
  • No dependencies.
  • Able to enlarge storage as long as the HDD space is available.
  • Storage capacity not limited by fixed size encryption container like in truecrypt etc.



• Installing encfs :
on Debian system.
sudo apt-get install encfs

• We need to create two folder :
(one for encrypted folder and another for mount point/folder).
mkdir <ENCRYPTED FOLDER> <MOUNT FOLDER>
mkdir ~/encfs/ ~/mnt/


• Setup :
encfs ~/encfs/ ~/mnt/
thing to remember, the path must be absolute. ie- /home/user/mnt   or   ~/mnt   and not   mnt .
Since we are mounting it for the first time it'll prcode_innerompt for a setup and a password. it's fairly easy.

• Mounting encrypted folder :
encfs ~/encfs/ ~/mnt/
To encrypt any file(s), save them in the ~/mnt/ folder.it will be visible in plain sight.
if you look at the ~/enfs/ folder, you will see the encrypted raw files. that is the real files. Everything in ~/mnt/ is a mirror of the files in ~/encfs/.

• Unmounting the encrypted folder :
umount ~/mnt/


Extra's

• Displaying Info:
encfsctl <ENCRYPTED_FOLDER>
encfsctl info <ENCRYPTED_FOLDER>

encfsctl ~/encfs/
encfsctl info ~/encfs/


• Changing password:
encfsctl passwd <ENCRYPTED_FOLDER>
encfsctl passwd ~/encfs/


• For usage and option's :
encfs --help
man encfs

Read more at EncFS Homepage and Wikipedia .