function [message] = decrypt(filename, K)
%DECRYPT Decrypts a text file using a given key K.
%  filename = the name (a string) of the file containing the text to 
%             decrypt.
%  message = plaintext decrypted by using substitution cipher K.
%  This function also writes the decrypted text to the file 'dec.txt'.

% readfile handles reading for you and stores the char array in m
m = readfile(filename);
% m now contains an array of characters specified by filename.

% WRITE YOUR CODE BELOW



% WRITE YOUR CODE ABOVE

% Write encrypted text to a file
writefile('dec.txt', message);