The following file cshift.txt is encrypted using a shift cipher. Decrypt it using key exhaustion. I expect to see 26 complete lines of output. Your program does not have to pick out which shift is English. You may do that by eyeball. Then print the proper plaintext (with spaces and punctuation) and then the encryption key. A program is a must.

BPQAT QNMQA IBMAB QBQAW VTGIB MABQN QBPIL
JMMVI VIKBC ITTQN MGWCE WCTLP IDMZM KMQDM
LQVAB ZCKBQ WVAWV EPMZM BWOWI VLEPI BBWLW

Shift: 18

THISL IFEIS ATEST ITISO NLYAT ESTIF ITHAD BEENA NACTU ALLIF EYOUW OULDH AVERE CEIVE DINST RUCTI ONSON WHERE TOGOA NDWHA TTODO

I assume you can split into proper English words.

perl program that found key:

my $cipher = "BPQAT QNMQA IBMAB QBQAW VTGIB MABQN QBPIL JMMVI VIKBC ITTQN MGWCE WCTLP IDMZM KMQDM LQVAB ZCKBQ WVAWV EPMZM BWOWI VLEPI BBWLW";
my @cipher = split(//,$cipher);

foreach my $i (0..26) {
my @plain = ();
foreach my $c (@cipher) {
if ($c =~ /\s/) {push @plain,$c;next;}
push @plain,chr(65+(ord($c)-65+$i)%26);
}
printf "\nShift: $i\n%s\n",join("",@plain);
}

To decrypt the given text using key exhaustion, we will try all possible keys (shifts) from 1 to 26 and see which key produces a valid decryption (plaintext that makes sense). Here's an example python program that can decrypt the given text using key exhaustion:

```python
def decrypt_shift_cipher(ciphertext):
for key in range(1, 27):
plaintext = ""
for char in ciphertext:
if char.isalpha():
# Decrypt uppercase letters
ascii_offset = ord('A') if char.isupper() else ord('a')
decrypted_char = chr((ord(char) - ascii_offset - key) % 26 + ascii_offset)
else:
# Keep non-alphabetic characters as is
decrypted_char = char
plaintext += decrypted_char
print(plaintext, "Key:", key)

# Ciphertext to decrypt
ciphertext = "BPQAT QNMQA IBMAB QBQAW VTGIB MABQN QBPIL JMMVI VIKBC ITTQN MGWCE WCTLP IDMZM KMQDM LQVAB ZCKBQ WVAWV EPMZM BWOWI VLEPI BBWLW"

# Decrypt the ciphertext using key exhaustion
decrypt_shift_cipher(ciphertext)
```

When you run the above program, it will output 26 lines, each with a possible decryption of the ciphertext using a different key (shift). You can examine the output and manually determine which key produces a valid plaintext. The output will also show the decrypted plaintext and the corresponding encryption key.

Note that in this program, we assume the shift cipher is a basic Caesar cipher that only shifts alphabetic characters. We try both uppercase and lowercase letters separately.

Please let me know if you need any further assistance!