diff --git a/crypto/13/solve.sh b/crypto/13/solve.sh new file mode 100755 index 0000000..1e50bb0 --- /dev/null +++ b/crypto/13/solve.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +echo "cvpbPGS{abg_gbb_onq_bs_n_ceboyrz}" | tr 'A-Za-z' 'N-ZA-Mn-za-m' diff --git a/crypto/caesar/ciphertext b/crypto/caesar/ciphertext new file mode 100644 index 0000000..da14148 --- /dev/null +++ b/crypto/caesar/ciphertext @@ -0,0 +1 @@ +picoCTF{dspttjohuifsvcjdpoabrkttds} \ No newline at end of file diff --git a/crypto/caesar/solve.py b/crypto/caesar/solve.py new file mode 100755 index 0000000..8cd280d --- /dev/null +++ b/crypto/caesar/solve.py @@ -0,0 +1,16 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python3 -p python3 + +def decrypt(ciphertext: str, key: int): + for letter in ciphertext: + shifted = chr(((ord(letter) - ord('a') + key + 26) % 26) + ord('a')) + print(shifted, end='') + print() + +if __name__ == "__main__": + with open('ciphertext') as file: + enc = file.read().strip()[len('picoCTF{'):-len('}')] + + # Note: seems to be the last one, "crossing the rubicon" + for shift in range(26): + decrypt(enc, shift) diff --git a/crypto/easy1/solve.py b/crypto/easy1/solve.py new file mode 100755 index 0000000..428381a --- /dev/null +++ b/crypto/easy1/solve.py @@ -0,0 +1,41 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python3 -p python3 + +# Character mapping table: +# +# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z +# +---------------------------------------------------- +# A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z +# B | B C D E F G H I J K L M N O P Q R S T U V W X Y Z A +# C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B +# D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C +# E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D +# F | F G H I J K L M N O P Q R S T U V W X Y Z A B C D E +# G | G H I J K L M N O P Q R S T U V W X Y Z A B C D E F +# H | H I J K L M N O P Q R S T U V W X Y Z A B C D E F G +# I | I J K L M N O P Q R S T U V W X Y Z A B C D E F G H +# J | J K L M N O P Q R S T U V W X Y Z A B C D E F G H I +# K | K L M N O P Q R S T U V W X Y Z A B C D E F G H I J +# L | L M N O P Q R S T U V W X Y Z A B C D E F G H I J K +# M | M N O P Q R S T U V W X Y Z A B C D E F G H I J K L +# N | N O P Q R S T U V W X Y Z A B C D E F G H I J K L M +# O | O P Q R S T U V W X Y Z A B C D E F G H I J K L M N +# P | P Q R S T U V W X Y Z A B C D E F G H I J K L M N O +# Q | Q R S T U V W X Y Z A B C D E F G H I J K L M N O P +# R | R S T U V W X Y Z A B C D E F G H I J K L M N O P Q +# S | S T U V W X Y Z A B C D E F G H I J K L M N O P Q R +# T | T U V W X Y Z A B C D E F G H I J K L M N O P Q R S +# U | U V W X Y Z A B C D E F G H I J K L M N O P Q R S T +# V | V W X Y Z A B C D E F G H I J K L M N O P Q R S T U +# W | W X Y Z A B C D E F G H I J K L M N O P Q R S T U V +# X | X Y Z A B C D E F G H I J K L M N O P Q R S T U V W +# Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X +# Z | Z A B C D E F G H I J K L M N O P Q R S T U V W X Y + +enc = "UFJKXQZQUNB" +key = "SOLVECRYPTO" + +if __name__ == "__main__": + for (x, y) in zip(enc, key): + decrypted = chr(((((ord(x) - ord('A')) - (ord(y) - ord('A'))) + 26) % 26) + ord('A')) + print(decrypted, end="") diff --git a/crypto/mod_26/solve.sh b/crypto/mod_26/solve.sh new file mode 100755 index 0000000..812c464 --- /dev/null +++ b/crypto/mod_26/solve.sh @@ -0,0 +1 @@ +echo "cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_Ncualgvd}" | tr 'A-Za-z' 'N-ZA-Mn-za-m' \ No newline at end of file diff --git a/crypto/the_numbers/numbers.txt b/crypto/the_numbers/numbers.txt new file mode 100644 index 0000000..76a6030 --- /dev/null +++ b/crypto/the_numbers/numbers.txt @@ -0,0 +1,10 @@ +16 9 3 15 3 20 6 { 20 8 5 14 21 13 2 5 18 19 13 1 19 15 14 } + +This is probably a number to letter mapping, in the form of +1->A, 2->B, 3->C, 4->D, ... + +Translation: +p i c o c t f { t h e n u m b e r s m a s o n } + +Flag: +picoCTF{thenumbersmason} diff --git a/crypto/the_numbers/the_numbers.png b/crypto/the_numbers/the_numbers.png new file mode 100644 index 0000000..786c917 Binary files /dev/null and b/crypto/the_numbers/the_numbers.png differ diff --git a/crypto/waves_over_lambda/ciphertext b/crypto/waves_over_lambda/ciphertext new file mode 100644 index 0000000..a645efa --- /dev/null +++ b/crypto/waves_over_lambda/ciphertext @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +pexmdiah csds bh reod kzim - kdsgosxpr_bh_p_efsd_ziyqni_emkyioxdik +------------------------------------------------------------------------------- +cifbxm cin heys abys ia yr nbhtehiz wcsx bx zexnex, b cin fbhbasn acs qdbabhc yohsoy, ixn yins hsidpc iyexm acs qeelh ixn yith bx acs zbqdidr dsmidnbxm adixhrzfixbi; ba cin hadopl ys acia heys kedslxewzsnms ek acs peoxadr peozn cidnzr kibz ae cifs heys bytedaixps bx nsizbxm wbac i xeqzsyix ek acia peoxadr. b kbxn acia acs nbhadbpa cs xiysn bh bx acs svadsys siha ek acs peoxadr, joha ex acs qednsdh ek acdss haiash, adixhrzfixbi, yeznifbi ixn qolefbxi, bx acs ybnha ek acs pidtiacbix yeoxaibxh; exs ek acs wbznsha ixn zsiha lxewx tedabexh ek sodets. b wih xea iqzs ae zbmca ex ixr yit ed wedl mbfbxm acs svipa zepizbar ek acs pihazs ndipozi, ih acsds ids xe yith ek acbh peoxadr ih rsa ae peytids wbac eod ewx ednxixps hodfsr yith; qoa b keoxn acia qbhadbau, acs teha aewx xiysn qr peoxa ndipozi, bh i kibdzr wszz-lxewx tzips. b hcizz sxasd csds heys ek yr xeash, ih acsr yir dskdshc yr ysyedr wcsx b aizl efsd yr adifszh wbac ybxi. diff --git a/crypto/waves_over_lambda/solve.py b/crypto/waves_over_lambda/solve.py new file mode 100755 index 0000000..ceccd13 --- /dev/null +++ b/crypto/waves_over_lambda/solve.py @@ -0,0 +1,85 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python -p python3 + +# NOTE: the colors are used to keep track of which letters have been +# already substituted, and which are still unknown. + +def green(s): + return f"\033[42m{s}\033[0m" + +def red(s): + return f"\033[41m{s}\033[0m" + +def substitute(cipher_text, substitution_map): + for letter in cipher_text: + if letter in substitution_map: + print(green(substitution_map[letter]), end="") + else: + print(red(letter), end="") + +with open('ciphertext', 'r') as file: + enc = file.read() + +# Here, I will be slowly substituting the letters in the ciphertext +# based on what I believe the words to be. I have commented out the +# invocations of substitute, and commented the newly found letters +# after each invocation. + +# Starting off, "csds bh reod kzim" looks like "here is your flag" + +substitution_map = { + '-': '-', + '_': '_', + '\n': '\n', + ' ': ' ', + ',': ',', + '.': '.', + ';': ';', + 'c': 'h', + 's': 'e', + 'd': 'r', + 'b': 'i', + 'h': 's', + 'r': 'y', + 'e': 'o', + 'o': 'u', + 'k': 'f', + 'z': 'l', + 'i': 'a', + 'm': 'g', +} + +# substitute(enc, substitution_map) + +# found: euro't'e, ligh'a', o'f'er, 'q'ri'a'ish +# suspect: euro p e, ligh t, o v er, b ri t ish + +substitution_map['t'] = 'p' +substitution_map['a'] = 't' +substitution_map['f'] = 'v' +substitution_map['q'] = 'b' + +# substitute(enc, substitution_map) + +# found: visite'n', british 'y'useu'y', sear'p'h, havi'x'g +# suspect: visite d , british m useu m , sear c h, havi'n'g + +substitution_map['n'] = 'd' +substitution_map['y'] = 'm' +substitution_map['p'] = 'c' +substitution_map['x'] = 'n' + +# substitute(enc, substitution_map) + +# found: fre'g'uency, 'l'no'w'n, 'j'ust, e'v'act +# suspect: fre q uency, k no w n, j ust, e'x'act + +substitution_map['g'] = 'q' +substitution_map['l'] = 'k' +substitution_map['w'] = 'w' +substitution_map['j'] = 'j' +substitution_map['v'] = 'x' + +substitute(enc, substitution_map) + +# still not sure about 'u'? But flag is found