How do I decode a binary string that is 1X104 characters long that is written in ASCII?
Mostrar comentarios más antiguos
string: 00001011000110110111100101111000011110000111101101101000000110100000011100001011000000110001101101101001
This string is suppose to contain a message, but everytime I try to decode it I get abstract letters and signs. Help?
1 comentario
Please do not post 2 questions about the same topic. See http://www.mathworks.com/matlabcentral/answers/52738-how-do-you-decode-a-binary-string-that-is-encrypted-in-ascii. It would be more helpful for the ones, who want to answer, if you answer question for clarifications and add new information by editing the original question. Thanks.
If you have any methods to decode this message, I strongly assume, that you have more information than you show. So please post at least the failing methods.
Respuestas (2)
Matt Fig
el 5 de Nov. de 2012
0 votos
How is the message stored? I.e., how many bits per letter, etc. It might help if you show how that string was generated from the ascii message.
Jan
el 5 de Nov. de 2012
Let's assume, that the code uses the same number of bits per character, so it it not run-length or Huffmann encoded. 104 has the factors 2,2,2,13, such that you have either 2, 4, 8, 13 or 26 bits per character, but even 104 bits are possible. E.g. this could be the ISBN number of a printed version of the Gettysburg address...
When We assume 8 bits, and the code is stored as sequential stream, we get these double values:
11, 27, 121, 120, 120, 123, 104, 26, 7, 11, 3, 27, 105
These are obviously not ASCII codes, because all values below 32 are non-printables like control characters. The numbers do not represent a simple character translation like a=1, b=2, ... A=27, B=28, because the value above 52 would be meaningless.
With 4 bits per character you can represent only 16 different values. Assuming the translation a=0,b=1,... you get:
alblhjhihihlgibkahaladblgj
This is not a word in a language I know.
1 comentario
Walter Roberson
el 5 de Nov. de 2012
8-bit at a time implementation:
char(bin2dec(reshape(S,8,[]).'))
This will give char([11,27,121 (etc)]) as described in Jan's answer.
Categorías
Más información sobre Standard File Formats en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!