Skip to content

Instantly share code, notes, and snippets.

@renshuki
Last active June 19, 2016 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renshuki/19bb7e6d09187d7808d9 to your computer and use it in GitHub Desktop.
Save renshuki/19bb7e6d09187d7808d9 to your computer and use it in GitHub Desktop.
Decipher a base64 like message

Introduction

Below a ciphered message (source):

QlpoOTFBWSZTWW8hhvwAAD7aAG0wAAsABQAKIAB1CVT8UEeRBJpRDRoaJoYJ2hHaMottLYUShiAD7GMfiBkCDGKMIrRvW41TxV5lWawgMpr4yNM4jiTfAZrPiH4u5IpwoSDeQw34

Deciphering

Step 1

No special characters so Ascii85 can be excluded.
Uppercase and lowercase are present so Base32 can be excluded.

Base64 can be deduced.

Using base64:

$ base64 -d source > base64_decoded

Open base64_decoded with vim (or an equivalent) and switch to HEX mode (:%!xxd)

base64_decoded file should be like that:

0000000: 425a 6839 3141 5926 5359 6f21 86fc 0000  BZh91AY&SYo!....
0000010: 3eda 006d 3000 0b00 0500 0a20 0075 0954  >..m0...... .u.T
0000020: fc50 4791 049a 510d 1a1a 2686 09da 11da  .PG...Q...&.....
0000030: 328b 6d2d 8512 8620 03ec 631f 8819 020c  2.m-... ..c.....
0000040: 628c 22b4 6f5b 8d53 c55e 6559 ac20 329a  b.".o[.S.^eY. 2.
0000050: f8c8 d338 8e24 df01 9acf 887e 2ee4 8a70  ...8.$.....~...p
0000060: a120 de43 0df8 0a                        . .C...

Step 2

With a short analyze of the first digits (425a 6839 3141 5926 5359 and BZh91AY&SYo) it seems to be the typical format of a BZ2 archive.

Rename base64_decoded:

$ mv base64_decoded base64_decoded.bz2

Extract:

$ bzip2 -d base64_decoded.bz2

Result of base64_decoded:

-[--->+<]>-.[---->+++++<]>-.+.++++++++++.+[---->+<]>+++.-[--->++<]>--.-------.--[--->+<]>--.+[---->+<]>+++.+[----->+<]>+.+.[--->+<]>-----.+[----->+<]>.--------.----.+++++++++++++.-----.+++++.-------.--[->+++<]>-.

Step 3

Morse code can be excluded.
It definitely looks like brainf_ck programming language.

Using bf:

$ bf base64_decoded
This has no meaning.% 

Ciphered message credits to Rémino

QlpoOTFBWSZTWW8hhvwAAD7aAG0wAAsABQAKIAB1CVT8UEeRBJpRDRoaJoYJ2hHaMottLYUShiAD7GMfiBkCDGKMIrRvW41TxV5lWawgMpr4yNM4jiTfAZrPiH4u5IpwoSDeQw34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment