Build TrueCrypt on OS X 64 bit with hardware acceleration
by cs
The TrueCrypt binary for OS X that you can get from truecrypt.org has several issues:
- It’s a universal binary for powerpc and i386 lacking 64 bit support;
- It uses an outdated version of FUSE that can cause all sorts of problems with other software that also relies on FUSE;
- As a universal binary, it doesn’t support hardware-accelerated AES encryption;
- You don’t really know what the mysterious TrueCrypt maintainers build into their binary
To address these problems, it’s best to build TrueCrypt from source. Here are some instructions. You’ll need a 64 bit cpu for this to work.
- Install MacPorts (don’t forget to install XCode and the Command Line Tools – these prerequisites are somewhat hidden on MacPorts’ installation page).
- Get some build dependencies from MacPorts (do not install osxfuse from MacPorts if you want to use your own build of osxfuse instead – see bottom of post for instructions):
sudo port install wxWidgets-3.0 osxfuse nasm wget pkgconfig
- Select wxWidgets-3.0:
sudo port select wxWidgets wxWidgets-3.0
- Download the TrueCrypt 7.1 source code (not sure whether I’m allowed to redistribute it).
- Extract the source code and change into the source directory:
tar -xzf Downloads/TrueCrypt\ 7.1a\ Source.tar.gz
cd truecrypt-7.1a-source - Download this patch:
wget http://www.nerdenmeister.org/truecrypt-osx.patch
- Download some Pkcs11 header files into the source directory:
mkdir Pkcs11
cd Pkcs11
wget ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11.h
wget ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11f.h
wget ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11t.h
cd ..
- Apply the patch:
patch -p0 < truecrypt-osx.patch
- Build:
make -j4
The GUI is still buggy on OS X 10.9 (Mavericks), but the command-line version works fine:
make -j4 NOGUI=1
- The application bundle will end up in
Main/TrueCrypt.app
. The command-line executable is located inMain/TrueCrypt
Update 19th Oct 2013: The patch is now under version control as a gist on github.
Update 28th Oct 2013: These instructions are not yet recommended for OS X 10.9 (Mavericks). MacPorts doesn’t seem to be ready yet.
Update 29th Oct 2013: The GUI is still very buggy on Mavericks, but the command-line version seems to be stable:
make -j4 NOGUI=1
The executable will end up in Main/TrueCrypt
.
Update 11th Nov 2013: If you want to use your own build of OSXFUSE instead of the MacPorts version, you’ll have to modify the following two files after patching the source code (i.e. after step 8):
Main/Main.make:100
-FUSE_LIBS = $(shell pkg-config fuse --libs)
+FUSE_LIBS = -L/usr/local/lib -losxfuse -pthread -liconv
Driver/Fuse/Driver.make:14
-CXXFLAGS += $(shell pkg-config fuse --cflags)
+CXXFLAGS += -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse
I’d recommend to uninstall fuse4x and fuse4x-kext in that case to avoid any mess.
Update 17th Nov 2013: Portfile is available on github now. If you’d like to see this integrated into MacPorts, please voice your support here.
Update 20th Apr 2014: Updated Portfile to switch to osxfuse because fuse4x has been deprecated by MacPorts.
Update 2nd Jun 2014: As TrueCrypt is down and the code isn’t available any longer from the official site, I’ve decided to start a Github repo that contains all changes that are required to build on OS X 64bit. This may also be useful for other platforms as the code was ported to wxWidgets 3.0 in the process.
Great guide, I’ve been trying to get TrueCrypt to compile on OS X for a week or so, this cut my build errors ten-fold. I’m still getting errors regarding wx-widgets when I build though.
“In file… ‘wx/wx.h’ file not found”
Any idea what’s going on? I installed wxWidgets-3.0 through MacPorts as you’ve shown. Any help would be appreciated.
Best Regards
Thanks for the report. There were 2 issues: First, wx-config doesn’t get installed by default any longer unless a wx version is explicitly selected. Second, the API for wxStandardPaths has changed. I’ve edited the instructions (new step 3) and the patch accordingly. You’ll have to apply the revised patch to a pristine source tree – it’s probably easiest to start over with step 3.
Worked like a charm. Much obliged.
Thank you so much for putting this together – I _never_ would have figured this out (well, without a whole lot of hours sunk in, anyway).
Thank you for this guide. – Just a few remarks:
– MacPorts might need to have the Apple Command Line Developer Tools installed to successfully perform step 2, otherwise one could end up with error messages like “Unable to execute port: can’t read “build.cmd”: Failed to locate ‘make’ in path: ‘/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin’ or at its MacPorts configuration time location, did you move it?”. Unfortunately, these tools are not installed by default (at least not in Xcode 5). You can however download and install the Apple Command Line Developer Tools by opening Xcode and pressing “Cmd + ,” which gives you a download interface for additional installable Xcode components, amongst them the tools.
– I also had to copy Pkcs11, Pkcs11f and Pkcs11t into /Common to get TrueCrypt to compile successfully.
Thanks for pointing out the MacPorts prerequisites, which are now mentioned in the instructions. Not sure why you would have to copy the pkcs headers to Common – are you sure you downloaded them to “Pkcs11” (note the capitalised “P”)?
Yes, you’re right, I’m sorry. – I couldn’t reproduce the error today when I compiled TrueCrypt again for a double check, so please excuse the false alarm.
By the way, thanks as well for publishing the patch on GitHub, your work is highly appreciated! 🙂
I installed OS X v. 10.9 (“Mavericks”) yesterday, with Xcode 5.0.1 and can no longer build:
Linking TrueCrypt
clang: warning: argument unused during compilation: ‘-pthread’
Undefined symbols for architecture x86_64:
“operator<<(std::__1::basic_ostream<wchar_t, std::__1::char_traits >&, wxCStrData const&)”, referenced from:
TrueCrypt::TextUserInterface::DoShowString(wxString const&) const in TextUserInterface.o
TrueCrypt::TextUserInterface::ImportSecurityTokenKeyfiles() const in TextUserInterface.o
TrueCrypt::UserInterface::SizeToString(unsigned long long) const in UserInterface.o
TrueCrypt::UserInterface::SpeedToString(unsigned long long) const in UserInterface.o
TrueCrypt::UserInterface::TimeSpanToString(unsigned long long) const in UserInterface.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [TrueCrypt] Error 1
make: *** [all] Error 2
Maverick doesn’t boot on my MacBook so that I can’t reproduce this. Did you do
sudo port selfupdate
sudo port upgrade -u outdated
and then in the truecrypt source directory:
make clean
before re-building?
This is strange – when I run the ‘port upgrade’, it tries to update bzip2, but seems to choke trying to run gnutar to unpack the source:
Error: org.macports.extract for port bzip2 returned: command execution failed
Please see the log file for port bzip2 for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/main.log
Error: Unable to upgrade port: 1
I tried to install gnutar and it choked trying to install one of its dependencies ‘expat’ which (you guessed it) also uses gnu tar to unpack itself.
Dirty workaround until MacPorts fixes this bug (have you reported it?):
sudo ln -s /usr/bin/tar /usr/bin/gnutar
Finally managed to install Mavericks and can confirm that the following works:
sudo ln -s /usr/bin/tar /usr/bin/gnutar
sudo port selfupdate
sudo port upgrade -u wxWidgets-3.0
Thanks again. It’s working for me, but first I completely uninstalled Macports, then installed the Mavericks version which just became available. All the prereqs started and I’m able to build!
I just tried this on Mavericks and received the same diagnostic message. Any additional information?
Please ignore My comment. The port file works.
Hello, thank you for the great work done on Truecrypt. Since the official build doesn’t seem to be updated lately, I was wondering what I should use.
Previously, I came across another build of Truecrypt that avoids the “Advanced format support error” : http://lenlo.wordpress.com/2013/03/19/truecrypt-mac-os-x-advanced-format-drives-true/
However, I found that this doesn’t seem to work for Hidden drives. i.e. it gives an error saying the OSX can’t support advanced formats when creating the outer disk (in a full disk encryption) that is bigger than 2GB.
I am wondering if someone has a workaround for the issue.
Also, is the above method you outlined in the blog post now ready to be used on Mavericks?
Thanks!
This version works fine for me with volumes > 2GB. Not sure about all “advanced formats” though.
MacPorts isn’t ready for Mavericks as of 25th Oct 2013, but you can get it to run with this hack:
sudo ln -s /usr/bin/tar /usr/bin/gnutar
MacPorts 2.2.1 has just been released and should be fully compatible with Mavericks.
I have Xcode installed, and found there was a very old nasm under /usr/bin that was causing build breakage.
The solution was to update Makefile explicitly point to the new ports nasm version.
Makefile:
export AS := /opt/local/bin/nasm
$ /usr/bin/nasm -v
NASM version 0.98.40 (Apple Computer, Inc. build 11) compiled on Aug 4 2012
$ /opt/local/bin/nasm -v
NASM version 2.10.09 compiled on Oct 23 2013
Thanks for the report. Usually, MacPorts modifies your
PATH
in~/.profile
so that/opt/local/bin
takes precedence over/usr/bin
, but there’s obviously no guarantee. I’ve modified the patch following your suggestion to make sure MacPorts’ nasm is used.I attempted to build Truecrypt from your instructions.
It properly made Truecrypt.app so I tried opening it, but when attempting to mount an encrypted file container, I get the following error:
fuse: bad mount point `’: No such file or directory
Thanks
Regarding Fuse, I thought fuse4x was merged to OSXFuse. (with osxfuse having support for Mavericks)
I’m not sure whether this has anything to do with the fuse error that I keep getting:
fuse: bad mount point `’: No such file or directory
Is it possible to change truecrypt into using the installed version of OSX Fuse on the system?
Yes it is. You’ll have to replace line 14 in Driver/Fuse/Driver.make from
CXXFLAGS += $(shell pkg-config fuse --cflags)
to whatever CXXFLAGS osxfuse requires, e.g.
CXXFLAGS += -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/fuse
or wherever your osxfuse header files are located.
You’ll also have to replace line 100 in Main/Main.make from
FUSE_LIBS = $(shell pkg-config fuse --libs)
to whatever link flags osxfuse requires, e.g.
FUSE_LIBS = -L/usr/local/lib -lfuse -pthread -liconv
or similar.
Finally, it’s a good idea to do
sudo port uninstall fuse4x
to avoid any confusion.
Let me know if this works for you.
The issue that you’ve reported (bad mount point) had nothing to do with fuse. I’ve fixed it in a revised version of the patch. Please test.
Its working! I was able to mount my truecrypt drives with the new patch under mavericks. Thanks!
Ok, testing it a little bit, I found a rather peculiar bug.
After closing the truecrypt window with a drive mounted, the truecrypt window does not reappear when clicking the dock icon.
When this happens, when I go to preferences, the truecrypt window reappears but as a white box with nothing in it.
Quitting and reopening truecrypt can reopen truecrypt with its regular window.
Yes, the GUI is still very buggy on Mavericks, but the command-line version seems to be stable:
make -j4 NOGUI=1
The executable will end up in
Main/TrueCrypt
.I’m a newbie in the unix world. Could you explain why using the -j4 option for make command? Thanks a lot.
This allows 4 parallel jobs to speed up building. See
make -h
andman make
for further information.I installed macports for mavericks. when I ran “sudo port install wxWidgets-3.0 fuse4x nasm wget pkgconfig”, i got this error:
—> Computing dependencies for tiff
—> Configuring tiff
Error: org.macports.configure for port tiff returned: autoreconf failure: command execution failed
Please see the log file for port tiff for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_tiff/tiff/main.log
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade tiff failed
can you give me any suggestions?
The short answer is: MacPorts doesn’t seem to be ready for Mavericks yet. For a longer answer, you’d have to look into the log file to see where it failed.
successfully compiled on Maverics.
Used MacPorts 2.2.1
[…snip…]
Compiling VolumePasswordWizardPage.cpp
Compiling VolumeSizeWizardPage.cpp
Compiling WizardFrame.cpp
Compiling Resources.cpp
Linking TrueCrypt
clang: warning: argument unused during compilation: ‘-pthread’
mac$ gcc –version
Configured with: –prefix=/Applications/Xcode.app/Contents/Developer/usr –with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
mac$ port
MacPorts 2.2.1
Entering interactive mode… (“help” for help, “quit” to quit)
[truecrypt/truecrypt-src] >
– Mounting of tc containers works
– the “volume creation wizard” hangs with first “next>”
Thanks for your feedback. I’m aware of the GUI problems on OS X 10.9, that’s why I recommend using the command-line version on Mavericks for now.
Are you aware of this topic? Any experience?
TrueCrypt + Mac OS X + Advanced Format Drives = True
Patch can be found here:
http://lenlo.wordpress.com/2013/03/19/truecrypt-mac-os-x-advanced-format-drives-true/
I was made aware of it by a comment here in the forum. So far there hasn’t been any feedback on advanced format drives. In case there are problems, I’d be happy to merge in lenlo’s patch (would obviously have to ask her/him for permission first).
It would be beneficial to put all this into a homebrew formula!
I’ve offered to put together a Portfile, but there hasn’t been any interest so far. Regardless of whether Homebrew or MacPorts is used, it’s unclear whether the TrueCrypt license allows you to redistribute the source code; it’s also impossible to get a stable link to the source tarball because they want you to accept the license before downloading.
Yes, and a Mac Port would be great.
Portfile is available on github now. If you’d like to see this integrated into MacPorts, please voice your support here.
Thanks a lot for your great guide. I’m trying to build truecrypt with wxwidgets 3.0 static library, but it doesn’t work. These are what I do.
1. compile wxwidgets 3.0 source code.
cd wxWidgets-3.0.0
mkdir mac-release
cd mac-release
../configure disable-shared –enable-unicode –enable-macosx_arch=x86_64 –with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.Platform/Developer/SDKs/MacOSX10.7.sdk
2. copy contents in mac-release folder to wxrelease folder in truecrypt directory.
3. compile truecrypt following all the steps in this article(except not installing wxWidgets-3.0 and fuse4x). when i build with ‘make WXSTATIC=1’, it shows me this error.
Linking TrueCrypt
Undefined symbols for architecture x86_64:
“_iconv_close”, referenced from:
wxMBConv_iconv::~wxMBConv_iconv() in libwx_baseu-3.0.a(baselib_strconv.o)
wxMBConv_iconv::~wxMBConv_iconv() in libwx_baseu-3.0.a(baselib_strconv.o)
“_iconv”, referenced from:
wxMBConv_iconv::wxMBConv_iconv(char const*) in libwx_baseu-3.0.a(baselib_strconv.o)
wxMBConv_iconv::ToWChar(wchar_t*, unsigned long, char const*, unsigned long) const in libwx_baseu-3.0.a(baselib_strconv.o)
wxMBConv_iconv::FromWChar(char*, unsigned long, wchar_t const*, unsigned long) const in libwx_baseu-3.0.a(baselib_strconv.o)
wxMBConv_iconv::GetMBNulLen() const in libwx_baseu-3.0.a(baselib_strconv.o)
(maybe you meant: wxMBConv_iconv::~wxMBConv_iconv(), new_wxMBConv_iconv(char const*) , wxMBConv_iconv::wxMBConv_iconv(char const*) , vtable for wxMBConv_iconv , wxMBConv_iconv::FromWChar(char*, unsigned long, wchar_t const*, unsigned long) const , wxMBConv_iconv::~wxMBConv_iconv() , wxMBConv_iconv::wxMBConv_iconv(char const*) , typeinfo name for wxMBConv_iconv , wxMBConv_iconv::~wxMBConv_iconv() , wxMBConv_iconv::ToWChar(wchar_t*, unsigned long, char const*, unsigned long) const , wxMBConv_iconv::GetMBNulLen() const , typeinfo for wxMBConv_iconv , wxMBConv_iconv::Clone() const , wxMBConv_iconv::ms_wcNeedsSwap , wxMBConv_iconv::ms_wcCharsetName )
“_iconv_open”, referenced from:
wxMBConv_iconv::wxMBConv_iconv(char const*) in libwx_baseu-3.0.a(baselib_strconv.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [TrueCrypt] Error 1
make: *** [all] Error 2
Any idea why this does not work? Thanks in advance!
Looks like some unicode/multibyte issue. I’d recommend you to use the same configure flags that MacPorts is using for wxWidgets-3.0, and add –disable-shared/–enable-static. This is the configure line on my system:
./configure --prefix=/opt/local \
--prefix=/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0 \
--with-libiconv-prefix=/opt/local --with-libjpeg --with-libtiff --with-libpng \
--with-zlib --with-opengl --with-cocoa --without-sdl --enable-aui --disable-sdltest \
--enable-unicode --enable-display --enable-xrc --enable-graphics_ctx \
--with-macosx-sdk=no --with-macosx-version-min=no
Works like a charm! Thanks a lot! Seems like the inbox libiconv doesn’t support X86_64? when I run “otool -L Truecrypt”, it shows i need the /opt/local/lib/libiconv.2.dylib library, the macports version. The static wxwidgets library also depends on external shared librarys, right? Does that mean if I want to use the application on another Mac, I need to make a distribution package to install both the app and libiconv library, or just use macports to install the wxwidgets? Is it possible to combine all the dependencies into the final app?
The easiest way to generate a portable app is arguably to create a binary installer with MacPorts. The Portfile for TrueCrypt is available on github. See here for how to use local Portfiles. If you’d like to see this integrated into MacPorts, please voice your support here.
Great job on the guide, helped me to use my containers after upgrading to 10.9 – Zero issues.
Very nice write up. Interestingly enough I couldn’t make the port work, it complained about not being able to use wx-setup which was weird because it was certainly able to install wxwidgets without issue. So I’m not entirely sure where that port fails, and ports really aren’t my area of expertise. I would guess that it didn’t have it included in the path yet, maybe a build order thing. Not sure.
Building it myself had no issues however. Not sure what’s going on there, but I needed to anyways because I wanted to use osxfuse. Thanks for saving me some time in figuring this out myself.
Additionally as you stated many of the GUI elements don’t function correctly, not that it’s necessary.
Hi, are you running Mac OS X Mavericks with OSXFUSE 2.6.2? If so, do you experience the problem that “Dismount All” in GUI verison always consumes a lot of time while the cursor is spinning. It has nothing to do with wxwidgets. Maybe a truecrypt or hdiutil bug? I just want to confirm if anybody experienced the same problem? Thank you!
Yes, I found the same thing, when using the GUI, dismount all takes a long time. However, I have switched to using only the command line, and that dismounts instantly. So the behavior seems specific to the GUI implementation.
I found that if I quit the GUI app and launch it again, dismounting only takes a second to finish. Weird!!
I just found something really interesting. If I set “Dismount All Volumes when TrueCrypt quits” on Preference dialog, then open Terminal and type “killall TrueCrypt”, all TrueCrypt processes disppear and all volumes get dismounted successfully. I think maybe there is some kind of lock between one of the process and hdiutil? If that process happens to be killed first, the volumes can be dismounted in a second. Funny:)
Hi. I know this post is not the place to post this thread. but can you please guide me to setup trueCrypt Source code on Mac OS ? as I want to debug and see how it works
Thanks.
This post is the place. If you scroll up to to the top you will find a guide to set up the TrueCrypt source code on MacOS.
Awesome guide. Thank you very much. Saved me probably hours.
I compiled this with static wxWidgets and osxfuse. Here’s the command line I used to configure wxWidgets: ./configure –prefix=$HOME/wxWidgets-3.0.0-install –disable-shared –with-macosx-version-min=10.7 CXXFLAGS=”-std=c++11 -stdlib=libc++” CPPFLAGS=”-stdlib=libc++” LIBS=-lc++
Probably MacPorts does that but I don’t use it so I wouldn’t know.
Anyway, you may want to add retina support as well to your patch. Icons are still scaled but at least fonts are sharp.
Build/Resources/MacOSX/Info.plist.xml:40
+
+ NSPrincipalClass
+ NSApplication
Thanks again.
Added in r2f16745
https://gist.github.com/neurodroid/7059368/revisions
Greetings! Very useful advice within this article! It is the little changes that make the most important changes. Many thanks for sharing! bdecfacfedae
The GUI issue is not limited to Mavericks. I just compiled it on 10.6.8 and several GUI elements are not working.
I do understand that a GUI is just secondary, but especially now (after TrueCrypt shut down) it would make sense to get it working.
Any idea how to do that? I’m not a GUI person, but I’d like to try and with help from a few people, I’m sure we can get it done.
I’ve just started a Github repo that should simplify collaborating on the code. As a first step we’d need to find out where the broken GUI elements are located in the code.
Hi cs,
A github repo is a great idea. I’ve done the same thing, but I used a different name, since we cannot use the original name.
https://github.com/tessus/HydraCrypt
I’ve added the user neurodroid as a collaborator and you have full access to the repo.
We have to change the name in the code from the original to the new name and also use a different icon.
I also did not add the pkcs includes (they are on my system anyway), because I’m not sure if we are allowed to distribute them.
As mentioned before, I’m not a GUI (nor Windows) person, but I was thinking about adding other encryption algorithms in the future.
So I really hope we can get this project going. My theory is that NSA, CIA, and other 3 or 4 letter agencies could not get a backdoor in the SW…
Can you please drop me a quick email. You can find my email address on my github profile: https://github.com/tessus
cs, could you shortly explain what the exact role of FUSE for OS X (or abbreviated: osxfuse) here is?
It is my understanding that FUSE for OS X has traditionally been used by the OS X versions of TrueCrypt to access NTFS file systems inside TrueCrypt containers. That being said, I wonder if installing the osxfuse package through MacPorts will interfere with the Paragon NTFS driver that I use or if the latter could replace the osxfuse functionality? Or is the fact that we’re installing the osxfuse package through MacPorts here only relevant for the compiled application?
Thanks in advance for clarifying that a bit! 🙂
An attempt to compile the source from your Github repository with MacPorts 2.3.3 on OS X 10.9.5 Mavericks gives me:
Mac-Pro:TrueCrypt-master User$ make -j4
Compiling Buffer.cpp
Compiling Exception.cpp
make[1]: g++-4.0: No such file or directory
Compiling Event.cpp
make[1]: g++-4.0: No such file or directory
make[1]: g++-4.0: No such file or directory
make[1]: *** [Buffer.o] Error 1
make[1]: *** Waiting for unfinished jobs….
make[1]: *** [Exception.o] Error 1
make[1]: *** [Event.o] Error 1
make: *** [all] Error 2
Mac-Pro:TrueCrypt-master User$
Does anybody see the error there? – Thanks!
make -f Makefile.osx
[…] had some crashes with TrueCrypt on OSX Yosemite. Then I found this post and decided to build my own TrueCrypt.app from source. The advantages should be use of 64bit […]
Hello
Is there any updates. Does it work on 10.13.6
Thanks
Hello
Is there any updates. Does it work on 10.13.6 or maybe 10.14 ?
Thanks
works on osx 10.15.1 with osxfuse 3.10.3. MacPorts fuse is too old and it wont work with osx 10.15.1.
After few bumps it looks like it work on 10.15.2.
Thank you very much!
Echoing Vladimir’s last comment, I was able to build it for 10.15.2. There were only three “bumps” that I encountered:
1) The 7.1a source is no longer obviously available from the TrueCrypt web page. Get it from https://github.com/FauxFaux/truecrypt
2) A version of osxfuse that will build in Catalina is no longer maintained in MacPorts, as described at https://trac.macports.org/ticket/59316 . As mentioned by pmininni in that ticket, you can overcome this by downloading FUSE from https://github.com/osxfuse/osxfuse/releases and setting the appropriate symlink.
3) Those links to pkcs11.h are no longer active. Download it from docs.oasis-open.org/pkcs11 . Here are the three files to wget:
http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/errata01/os/include/pkcs11-v2.40/pkcs11.h
http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/errata01/os/include/pkcs11-v2.40/pkcs11t.h
http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/errata01/os/include/pkcs11-v2.40/pkcs11f.h
Note that the GUI works just fine!