Steps to install encrypted partition.
sudo apt-get install gparted
The partition I wanted to resize was mounted so gparted wouldn't resize it.
I rebooted into windows and used windows disk management to resize it, but this also couldn't resize it.
I rebooted into Ubuntu Live but gparted here couldn't see the drive (Not on drop down)
I ran a terminal and ran the command:
I can see my drive
It was not listed so not mounted
So I tried
sudo gparted /dev/nvmee0n1
and gparted launched
Use gparted to reduce linux ext4 disk by 20Gb (19073 Mib)
(on my PC this left 568781 Mib remaining as the linux partition)
I restarted to ensure that ubuntu still worked with smaller partition. It did :)
sudo apt-get install cryptsetup
sudo modprobe dm_crypt
I now launched disks in normal environment and I had unallocated space to create the encrypted partition.
It is mounted at /media/robert/Encrypted