%to make color plots with messages and keys and corresponding hash value
%sorted by message (each set of messages starting with same letter and
%corresponding set of keys and hash values in diferent color plots)
function make = eachmestot(X,Y,L,T)%L=length of message, X ascii character alphabet starts with,Y ascii character alphabet ends with, T=type of hashing method
Mat=color2(X,Y,L,T);
Mat=sortrows(Mat,1:L);%sort matrix of all messages and keys their corresponding hash values, by message
b=0;
x1=double(X);%numerical representation of smallest ascii number in our alphabet
y1=double(Y); %numerical representation of largest ascii number in our alphabet
y=y1-x1;
A=(y1-x1)+1; %length of alphabet
for i=0:y;%for each character first spot of message can start with
    for j=1:A*(A^L);%for all possible sets of characters in rest of message and their combinations with different keys and hash values
        %make matrices of all hash value and key combinations for each set
        %of messages starting with each possible character
        if Mat(j,1)==i
            b=b+1;
            Make(b,:)=Mat(j,:);
        end;
    end;
    figure
    imagesc(Make,[min(Make(:)) max(Make(:))]); 
    colormap(colorcube)
    b=0;
end;