My goal here is to decode an encrypted message using perfect-k-shuffles, the encryption key is given
Mostra commenti meno recenti
here is what I have so far, I dont know how I am supposed to decode the message
encodedString = 'aasfu aic talputte balde'; % Encrypted message
encryptionKey = [6,7];% stores the m-value used in
% perfectMShuffle() function and the number of shuffles performed.
N = 1000;
cl = zeros(N/2,1);
for n = 2:2:N
ordered = [1,n]';
encodedString = ordered;
encodedString = perfectMShuffle(encodedString,encryptionKey);
counter = 1;
while any(encodedString - ordered)
encodedString = perfectMShuffle(encodedString,encryptionKey);
counter = counter + 1;
end
cl(n/2) = counter;
end
here is my perfectMshuffle function
function outString = MekuluperfectMShuffle(inString,m)
n = length(inString);
X = n/m;
outString = reshape(reshape(inString,X,m)',n,1);
end
4 Commenti
Walter Roberson
il 19 Ott 2013
It seems a bit early to get to this point when you have not yet finished with your earlier question
Walter Roberson
il 19 Ott 2013
Duplicates http://www.mathworks.co.uk/matlabcentral/answers/90231-i-am-trying-to-decode-an-encrypted-message
Code from here should be entered into existing question.
Kevin Junior
il 19 Ott 2013
Walter Roberson
il 19 Ott 2013
You do not need multiple active questions on the same topic. You should merge them into one question.
Risposte (0)
Categorie
Scopri di più su Encryption / Cryptography in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!