Decryption of an 8-bit code

4 vues (au cours des 30 derniers jours)
Katherine Brideau
Katherine Brideau le 27 Mar 2013
I'm trying to crack a code that's concatenated ascii codes, encrypted by xor'ing each ascii code with an 8 bit key. Decoding it is apparently an xor operation, however I've hit a brick wall.
My algorithm is 1) create a decrypt code 2) xor each letter with code 3) translate back to a number 4) change number to letter 5) print out message
3,4, and 5 a straightforward, but I can't move past 1 and 2
My code so far is
encrypted = '11111111111111111011101111100000000100000000101000101000000001000100010111101001001010111010100011100101';
z = reshape(encrypted, length(encrypted)/8,8)
key = dec2bin(0:255,8)
Basically I'm going to use brute force to crack it, and split things off into groups of 8.
If anyone has any suggestions I would really appreciate it!
Thank you
  1 commentaire
Walter Roberson
Walter Roberson le 27 Mar 2013
You probably want
z = reshape(encrypted .', 8, length(encrypted)/8).' ;

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 27 Mar 2013
You cannot reliably break xor codes using brute force. You cannot, for example, determine whether the original source was
IBM
or
HAL
(as in 2001's HAL 9000 computer)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by