Code to split data taken from user in 32 bits block

I am working on a project to encipher data in Matlab using the blowfish algorithm. That is why I need a code to split data taken from the user into blocks of 32 bits. Also I don't want to use a file to read the data because I read that it might be time consuming in case of matlab , but any suggestions are welcome in that case too.
Here is a link to the code that I have worked on - link I found out that each character's length is 2 bytes.Using that , I was working on a code like this but I think this is wrong.
note: I want a code that gives me block of 32 bits in string
word = cell(1,10000);
for i=1:2:length(str)-2
word{1,i} = str(i:i+1);
end

 Accepted Answer

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!