I have an USB hard drive which contains an encrypted Linux LUKS partition whose password I have forgotten. However, I have a list of possible passwords as a text file. One password candidate per line. There are about 100 password candidates in this file.
I need you to write a script I can run in Linux that will try to open the USB hard drive, which is at /dev/sde1, using each of the passwords from the given file until the correct password is found or all of the passwords have been tested and none of them is correct.
The script could be made in any scripting language you want but Perl would be preferred.