If you're already using the new LUKS2 format, you can set a label:
For new LUKS2 containers:
# cryptsetup luksFormat --type=luks2 --label=foobar foobar.img
# blkid /dev/loop0
/dev/loop0: UUID="fda16145-822e-405c-9fe8-fe7e7f0ddb5e" LABEL="foobar" TYPE="crypto_LUKS"
For existing LUKS2 containers:
# cryptsetup config --label=barfoo /dev/loop0
# blkid /dev/loop0
/dev/loop0: UUID="fda16145-822e-405c-9fe8-fe7e7f0ddb5e" LABEL="barfoo" TYPE="crypto_LUKS"
However, it's not possible to set a label for the more common LUKS1 header.
With LUKS1, you can only set a label on a higher layer. For example, if you are using GPT partitions, you can set a PARTLABEL.
# parted /dev/loop0
(parted) name 1 foobar
(parted) print
Model: Loopback device (loopback)
Disk /dev/loop0: 105MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 104MB 103MB foobar
This sets the partition label of partition 1 to "foobar".
You can identify it with PARTLABEL=foobar or find it in /dev/disk/by-partlabel/
# ls -l /dev/disk/by-partlabel/foobar
lrwxrwxrwx 1 root root 13 Oct 10 20:10 /dev/disk/by-partlabel/foobar -> ../../loop0p1
Similarly, if you use LUKS on top of LVM, you could go with VG/LV names.
As always with labels, take extra care to make sure each label doesn't exist more than once. There's a reason why UUIDs are meant to be "universally unique". You get a lot of problems when trying to use the wrong device; it can even cause data loss (e.g. if cryptswap formats the wrong device on boot).