**Cryptographie 50 - Ultracoded ** Énoncé : Fady didn't understand well the difference between encryption and encoding, so instead of encrypting some secret message to pass to his friend, he encoded it! Hint: Fady's encoding doens't handly any special character Un fichier à notre disposition contenant : ZERO ONE ZERO ZERO ONE ONE ZERO ZERO ZERO ONE ONE ZERO ONE ZERO ZERO ONE ZERO ZERO ONE ONE ZERO ZERO ZERO ZERO ZERO ONE ONE ZERO ZERO ONE ONE ONE ZERO ONE ZERO ZERO ONE ONE ZERO ZERO ZERO ONE ONE ZERO ONE ZERO ZERO ONE ZERO ZERO ONE ONE ZERO ZERO ZERO ZERO ZERO ONE ONE ONE ZERO ONE ZERO ONE ZERO ONE ZERO ZERO ONE ONE ZERO ZERO ZERO ONE ONE ZERO ONE ZERO ZERO ONE ZERO ONE ZERO ZERO ZERO ZERO ZERO ONE ZERO ONE ONE ONE ZERO ONE ZERO ONE On va remplacer le mot "zero" par 0 et "one" par 1. #!/usr/bin/python2.7 mon_fichier=open("zero_one","r") text="" for line in mon_fichier.read().split(" "): if line=="ZERO": text+="0" else : text+="1" if len(text) >= 8 : print text text="" mon_fichier.close() On créé ensuite des pacquets de 8 pour le traduire en ascii.([[http://www.rapidtables.com/convert/number/binary-to-ascii.htm| Binaire to ASCII]]) On obtient une chaines de caractères qui est du base64 : Li0gLi0uLiAuIC0uLi0gLS4tLiAtIC4uLS4gLSAuLi4uIC4tLS0tIC4uLi4uIC0tLSAuLS0tLSAuLi4gLS0tIC4uLi4uIC4uLSAuLS0uIC4uLi0tIC4tLiAtLS0gLi4uLi4gLiAtLi0uIC4tLiAuLi4tLSAtIC0tLSAtIC0uLi0gLQ== On la décode : echo "Li0gLi0uLiAuIC0uLi0gLS4tLiAtIC4uLS4gLSAuLi4uIC4tLS0tIC4uLi4uIC0tLSAuLS0tLSAuLi4gLS0tIC4uLi4uIC4uLSAuLS0uIC4uLi0tIC4tLiAtLS0gLi4uLi4gLiAtLi0uIC4tLiAuLi4tLSAtIC0tLSAtIC0uLi0gLQ==" | base64 -d On obtient : .- .-.. . -..- -.-. - ..-. - .... .---- ..... --- .---- ... --- ..... ..- .--. ...-- .-. --- ..... . -.-. .-. ...-- - --- - -..- - Cette chaîne est du morse. On la décode avec ce site : [[http://www.dcode.fr/code-morse|Décode morse]] ALEXCTFTH15O1SO5UP3RO5ECR3TOTXT Pour obtenir le flag , il faut remplacer les 0 par des _ : ALEXCTF{TH15_1S_5UP3R_5ECR3T_TXT}