Hope this helps.
I changed the code only slightly, just to extract the decrypt file name.
I added a
test program, and the results indicate that both \r and \n were written to and read from the encrypted file.
Suspect that you were using readline to read the decrypted file, and readline does not read the end of line characters. I used read instead, and the end of line characters are in the decryped file.
The output from the test is shown here, and contains both \n\r.
Decrypt: "Line 1: Have a happy day.
" has \n true has \r true
Decrypt: "Line 2: It was snowing this afternoon.
" has \n true has \r true
Decrypt: "Line 3: Will it rain tommorrow.
" has \n true has \r true
Decrypt: "Line 4: It's getting late.
" has \n true has \r true
Decrypt: "" has \n false has \r false