It is possible, but be warned: your data is toast if anything goes wrong. I strongly suggest finding some way to back up first.
Since you can't use external data storage, you have to do it in place.
This assumes the data in your data partition can fit in half the current space.
- Resize and move the data partition to half its current size at the end of the disk.
- In the newly-created free space, create a new encrypted LUKS volume, and create a new filesystem inside it.
- Copy all files from the old partition to the new one, then delete the old partition.
Resize the encrypted volume (based on the instructions here):
Show the size of your crypt with cryptsetup.
sudo cryptsetup status crypt1
This shows the size of your crypt in sectors.
Make note of the offset
offset: 2056 sectors
Resize with cryptsetup.
sudo cryptsetup -o 2056 -b 11800000 resize crypt1
-o = offset (get this from the status command) -b = size in sectors.
- Finally, resize the filesystem contained in the encrypted volume to the full size. If you used ext3/4,
sudo resize2fs /the/partition
should suffice.
If your data takes up more than half the space, you can adapt this procedure by starting with a smaller encrypted partition, and resizing and copying some of the files several times. Obviously more laborious.