Compiling Veracrypt on your NAS

Currently reading
Compiling Veracrypt on your NAS

2
2
NAS
DS1618
Operating system
  1. Linux
  2. macOS
  3. Windows
Mobile operating system
  1. Android
After much searching and few options on how to do this, I thought I'd have a crack at compiling this myself. I hope someone finds this useful!

There is a container version available, but this lacks some Veracrypt functionality. (eg, mounting whole devices)

Making the mounted drive network-available is also tricky - Samba appears to not allow visibility of FUSE drives, even with 'allow_other' configured. However, although slower, SSHFS works just fine.

DISCLAIMER:
This is for the braver of you, and I offer no assurances this will work for you as it did for me.

REQUIREMENTS:
DSM 6.x
entware oPKG
entware dev headers
Various entware packages
yasm 1.3.0 (source)
VeraCrypt 1.24.update7 (source)
wxWidgets (source)
catch-wx (source)

1) install entware (this will provide you with most of the packages you'll need to compile with):
How To Install a Package Manager on a Synology NAS/Router (ipkg/oPKG)

2) log into the CLI and install these packages:
Bash:
sudo -i
opkg install make nano coreutils coreutils-od findutils-locate sed tar gcc ldd less bzip2 zlib gawk pkg-config

you may also have to upgrade tar further:
Bash:
opkg upgrade tar

3) download required headers:
dev packages (in this case libfuse-dev) are not provided by entware. however, most headers (including the fuse headers) can be manually downloaded. find your architecture in /opt/etc/entware_release. for my DS1618+ architecture of x86_64:
Bash:
sudo -i
cd ~
mkdir include
cd include
curl http://bin.entware.net/x64-k3.2/include/include.tar.gz > include.tar.gz
mv include.tar.gz include
tar xvzf include.tar.gz
mv * /opt/include
cd ~
rmdir include

4) download and install yasm:
Bash:
curl http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz > yasm-1.3.0.tar.gz
tar xvzf yasm-1.3.0.tar.gz
cd yasm-1.3.0
sed -i 's#) ytasm.*#)#' Makefile.in
./configure --prefix=/usr
make
make install
yasm -v

5) download wxWidgets:
Bash:
curl https://github.com/wxWidgets/wxWidgets/archive/master.zip > wxWidgets.zip
unzip wxWidgets.zip

6) download catch-wx:
Bash:
curl https://github.com/wxWidgets/Catch/archive/ee4acb6ae6e32a02bc012d197aa82b1ca7a493ab.zip > catch.zip
unzip catch.zip
mkdir wxWidgets-master/3rdparty/catch
mv Catch-Wx/* wxWidgets-master/3rdparty/catch
rmdir Catch-Wx

7) download VeraCrypt:
Bash:
curl https://github.com/veracrypt/VeraCrypt/archive/master.zip > veracrypt.zip
unzip veracrypt.zip

8) configure the wxWidgets static library for VeraCrypt and build it:
Bash:
cd ../VeraCrypt-master/src/
make WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets ARCH=X86-64 CC=gcc wxbuild

9) create /opt/lib/pkgconfig/fuse.pc, with the following contents:
Code:
prefix=/opt
exec_prefix=${prefix}
libdir=/opt/lib
includedir=${prefix}/include

Name: fuse
Description: Filesystem in Userspace
Version: 2.9.9
Libs: -L${libdir} -lfuse -pthread
Libs.private: -ldl
Cflags: -I${includedir}/fuse -D_FILE_OFFSET_BITS=64

10) compile VeraCrypt:
Bash:
cd ../VeraCrypt-master/src/
make  NOGUI=1 WXSTATIC=1 ARCH=X86-64 CC=gcc AS=/bin/yasm NOASM=1
make install
veracrypt --version

11) Copy to opt/bin:
Bash:
cp ~/VeraCrypt-master-src/Main/veracrypt /opt/bin

12) mount some volumes!
As the Synology kernel may not natively support the encryption scheme you are using, when mounting, use this option: "-m=nokernelcrypto"

mounting a veracrypt volume:
Bash:
veracrypt -k "" --pim=0 --protect-hidden=no -m=nokernelcrypto container.hc /media/veracrypt1

mounting a device with Truecrypt compatibility:
Bash:
veracrypt -tc -k "" --pim=0 --protect-hidden=no -m=nokernelcrypto /dev/sdu /media/veracrypt1

USEFUL RESOURCES:
How To Install a Package Manager on a Synology NAS/Router (ipkg/oPKG)
Truecrypt 7 on Synology
veracrypt/VeraCrypt
yasm-1.3.0
Entware/Entware
 
2
2
NAS
DS1618
Operating system
  1. Linux
  2. macOS
  3. Windows
Mobile operating system
  1. Android

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Similar threads

Similar threads

Trending threads

Top