What's new

Usb drive encryption

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Markfree

Regular Contributor
Guys,

I had 2 external usb drives connected to my Asus AC87u router. Unfortunately, one of them stolen but the other remained as a backup.

Since I lost one drive, probably all my data on it was seen, copied or something else. To avoid this misfortune, I was wondering if there is a software to encrypt my USB drives connected to Asus router, pretty much like Windows bitlocker. So, even if I take the drive off the router, it will open only with a password.

Thank you.
 
Sorry to hear about your loss - many external drives do have Kensington lock slots...

Not a big fan of encryption on external drives as it complicates swaps and recovery, but if one can't lock one down, encryption is better than anything...
 
I was looking for a solution that would allow me to use USB drive through my router, including SMB and Webdav features. And, by removing the drive from the router and placing it on another computer, password would still be asked.
ASAT, do you think those options work like that?
 
the router supports this?
My wish is to read and write an encrypted USB flash drive plugged into the router that was originally formatted (ext4 + LUKS) on Ubuntu. So I will try enabling dm-crypt in the kernel config of the Asuswrt-Merlin firmware and see what happens...

~/asuswrt-merlin/release/src-rt-6.x.4708/linux/linux-2.6.36/config_base.6a
Code:
CONFIG_MD=y
CONFIG_BLK_DEV_DM=m
CONFIG_DM_CRYPT=m
CONFIG_CRYPTO_XTS=m
CONFIG_CRYPTO_RMD160=m
CONFIG_CRYPTO_RMD256=m
CONFIG_CRYPTO_RMD320=m
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_TGR192=m
CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_FCRYPT=m
CONFIG_CRYPTO_KHAZAD=m
CONFIG_CRYPTO_SALSA20=m
CONFIG_CRYPTO_SEED=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_TEA=m
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m


Then, I will install a package from Entware-ng and attempt to mount my encrypted USB flash drive. Will it work?
Code:
opkg update
opkg install cryptsetup
/sbin/insmod dm-mod.ko
/sbin/insmod dm-crypt.ko
/sbin/insmod gf128mul.ko
/sbin/insmod xts.ko
cryptsetup luksOpen /dev/sdb1 usbcrypt
/bin/mkdir /mnt/usbcrypt
/bin/mount /dev/mapper/usbcrypt /mnt/usbcrypt
/bin/umount /mnt/usbcrypt
cryptsetup luksClose usbcrypt
/sbin/rmmod xts
/sbin/rmmod gf128mul
/sbin/rmmod dm-crypt
/sbin/rmmod dm-mod


REFERENCES
https://gitlab.com/cryptsetup/cryptsetup
https://wiki.gentoo.org/wiki/Dm-crypt
https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption
 
Last edited:
Did someone get real-time encryption working? I would also like external HDD (attached to AC87U via USB3) to be encrypted, so if someone takes my drive, he can't access files (pretty much like TrueCrypt works, for example). I don't mind typing a password every time disk is mounted or router is rebooted (since it not happens often).
 
Did someone get real-time encryption working?
Yes, just in case the FBI comes, I believe someone did. For example, here is the things you must do to run Entware-NG from an encrypted USB3 HDD. Would be nice to see support from Asus here. Otherwise, you're stuck doing it all yourself.
  1. Enable the dm-crypt feature and other required modules in the kernel and recompile the firmware.
  2. Make a version of cryptsetup and its dependent libraries that either runs from /jffs or is compiled directly into the firmware. If your /opt partition resides on the encrypted disk, then you cannot run cryptsetup from /opt. Duh.
  3. Create a pre-mount script to automatically mount the encrypted disk at boot time, and use services-stop to un-mount it. Unfortunately, there is no Asus /etc/crypttab as with a modern Linux OS.
  4. You could use an 3.3V Arduino Pro Mini to automatically enter a passphrase, very early in the boot process. How to make it secure?

Thoughts?
  • The only noticeable performance hit is when running Transmission, when it starts the download of a large file. The CPU spikes for more than a moment because it's pre-allocating the file and encrypting the empty space.
  • Don't forget to encrypt the swap partition.
  • Would be nice to encrypt the /jffs partition too.
  • If all you want to do is encrypt a removable USB flash drive, then your task is simpler. No boot time authentication issues to figure out.
 
Last edited:
Am I the only who can't open this link (tested on 3 browsers)? Getting redirected to main docs page every time.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top