1.) I have an ASCII text and a random 128-bit key. I want to concat those two things, so I convert the ASCII text into hex and then to a BitArray.
var text="kheil" ; var textHex=asc2hex(text);var textBitArray= sjcl.codec.hex.toBits(textHex);
I get the following BitArray :
What is worrying me is the last number, why is it longer ? It's more than a 32-bit number. With some ASCII text, it's fine I get a BitArray with 32-bit numbers but with some others I get this kind of suff, is it normal ? And If I concat it with a random number :
-96822511,1783357814,2009621896,-1425360948, I get :
1802003817,1828338331,292178913,1987561573,-2002056521,8795220606976 which is not a good concatenation no ? My guess is that the text is not a multiple of 32-bits, but how to get a good BitArray for any text ?
2.) Also to compute a random 128-bit key I use sjcl.random.randomWord(4,0), is it an efficient function to compute a random key ? I read somewhere that I should not use 0 as paranoia, or it's necessary to call startCollector() to get entropy. I am bit confuse about that, could any one explain that to me ?
Thank you !