Yiming Zhang (C1)
Folder name:Yiming_Zhang
-------------------------------------------------
PART A: Write a function subEncrypt such that will encode a message using the simple substitution algorithm discussed in the introduction.
function encrypt=subEncrypt( plaintxt,key )
%this function help to encode a message using the simple substitution algorithm
%Your plaintxt should be entered in all capitals numkey=(65:90);
%stand for Letters A~Z encrypt=zeros(1,length(plaintxt));
%vectors with the length of your massage
%equivalents of the encrypted message. for ASC=1:length(plaintxt) num=find(numkey==plaintxt(ASC)); encrypt(ASC)=key(num); end end
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
-------------------------------------------------
PART B: Write a function subDecrypt such that it will decrypt a message