the question is : encrypt and decrypt message with length 64 char by using matlab ... this code is an example of encrypt decrypt message of 12 char
Show older comments
d=['z' 'i' 'a' 'd' '' 'a' 'l' 'q' 'a' 'd' 'i' '' ], d1=uint8(d); %inv d1 k=13; for i=1:12 c(k)=d1(i); k=k-1; end %add 3n-2 for i=1:12 c(i)=c(i)+3*i-2; end %subtract 3n-2 for i=1:12 m(i)=c(i)-3*i+2; end %iners n=12; for i=1:12 r(n)=m(i); n=n-1; end d char(r)
3 Comments
Purushottama Rao
on 25 Jun 2015
what is that you are looking for? An explanation on above code?
yazan hejjawe
on 25 Jun 2015
Edited: yazan hejjawe
on 25 Jun 2015
Walter Roberson
on 25 Jun 2015
Which part is the "message"? Which part is the "encrypted message"? What information is being given to you to decrypt? For example are you given s and k ?
Answers (1)
James Tursa
on 25 Jun 2015
Edited: James Tursa
on 25 Jun 2015
0 votes
If you want to use the 5 x 5 code above, break the input into 25 character sets and process each set separately. If you have one set less than 25 pad with something (e.g., blanks with value 32).
Categories
Find more on Encryption / Cryptography in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!