åå ã¯ãpicoCTF ã® picoCTF 2024 ã®ãã¡ãForensics ããã£ã¦ã¿ã¾ãããå
¨8åã®ãã¡ãæå¾ã® 2åã¯è§£ãã¾ããã§ããã
ä»åã¯ãå¼ãç¶ããpicoCTF ã® picoCTF 2024 ã®ãã¡ãCryptography ã¨ããã«ãã´ãªã®å
¨5åããã£ã¦ããããã¨æãã¾ããEasy ã 1åãMedium ã 3åãHard ã 1åã§ãã
ããã§ã¯ããã£ã¦ããã¾ãã
ã¯ããã«
ãã»ãã¥ãªãã£ãã®è¨äºä¸è¦§ã§ããè¯ãã£ããåèã«ãã¦ãã ããã
ã»ãã¥ãªãã£ã®è¨äºä¸è¦§
picoCTF ã®å
¬å¼ãµã¤ãã¯ä»¥ä¸ã§ããè±èªã®ãµã¤ãã§ãããã·ã³ãã«ã§åãããããã®ã§å°ããã«é²ãããã¨ãã§ãã¾ãã
picoctf.com
ããã§ã¯ããã£ã¦ããã¾ãã
picoCTF 2024ï¼Cryptography
ãã¤ã³ãã®ä½ãé ã«ãã£ã¦ããã¾ãã
interencdecï¼50ãã¤ã³ãï¼
Easy ã®åé¡ã§ãããã¡ã¤ã«ã1ã¤ï¼enc_flagï¼ãã¦ã³ãã¼ãã§ãã¾ãã
ãã¡ã¤ã«ãéãã¨ãYidkM0JxZGtwQlRYdHFhR3g2YUhsZmF6TnFlVGwzWVROclh6ZzVNR3N5TXpjNWZRPT0nCg==
ã¨æ¸ããã¦ãã¾ããBase64 ã£ã½ãã®ã§ããã³ã¼ããã¦ã¿ã¾ãã
ãã¼ããéãããã§ãããã 1å Base64 ã§ãã³ã¼ãããã¨ããæãã«ãªãã¾ããã
$ cat enc_flag | base64 -d
b'd3BqdkpBTXtqaGx6aHlfazNqeTl3YTNrXzg5MGsyMzc5fQ=='
$ echo -n 'd3BqdkpBTXtqaGx6aHlfazNqeTl3YTNrXzg5MGsyMzc5fQ==' | base64 -d
wpjvJAM{jhlzhy_k3jy9wa3k_890k2379}
ãã¨ã¯ãã·ã¼ã¶ã¼æå·ã§ããããã§ã¯ãASCIIã³ã¼ãã®æ°å¤ãæ±ãã¾ãã7 ãæ¸ç®ããã°è¯ãããã§ãã
>>> ord('C'), ord('T'), ord('F')
(67, 84, 70)
>>> ord('J'), ord('A'), ord('M')
(74, 65, 77)
picoCTF{caesar_d6cr2pt6d_123d5602}
ã ã¨æã£ãã®ã§ãããéãã¾ããã
Base64ã®ãã³ã¼ã
ã¡ãã£ã¨é©å½ã ã£ãã®ã§ãããã¡ãã£ã¨çé¢ç®ã«èãã¾ããenc_flag ã«æ¸ããã¦ããæååã¯ã70æå㨠==
ã§ãã==
㯠4æåã¢ã©ã¤ã¡ã³ãã«ä¸è¶³ãã¦ããã ããªã®ã§æ°ã«ããªãã§ããã§ããBase64 㯠6bit ã 1æåã§è¡¨ãã®ã§ããã³ã¼ãããã¨ã70æåÃ6bit=420bit
ã«ãªãã¾ãããå
ã®æå㯠8bit ãªã®ã§ã416bit 㧠4bit 㯠0 ã足ãããã ãã§ããæå¾ã®æå㯠g
ã§ãããã¯ã2é²æ°ã§ 100000
ãå¤æãããã®ãªã®ã§ããã®å¾ãã® 4ã¤ã® 0 ã¯è¶³ãããã ãã§æ°ã«ããªãã§ããã§ãã416bit 㯠52æåã«ãªãã¾ããããããb'd3BqdkpBTXtqaGx6aHlfazNqeTl3YTNrXzg5MGsyMzc5fQ=='
㯠51æåããããã¾ããã
ãã¼ããå°ã£ãã®ã§ãèªå㧠base64 ããã³ã¼ãããããã°ã©ã ãä½ãã¾ããã
def base64_decode_manual( ss ):
print( f"len(ss)={len(ss)}" )
table = {
'A': "000000", 'B': "000001", 'C': "000010", 'D': "000011",
'E': "000100", 'F': "000101", 'G': "000110", 'H': "000111",
'I': "001000", 'J': "001001", 'K': "001010", 'L': "001011",
'M': "001100", 'N': "001101", 'O': "001110", 'P': "001111",
'Q': "010000", 'R': "010001", 'S': "010010", 'T': "010011",
'U': "010100", 'V': "010101", 'W': "010110", 'X': "010111",
'Y': "011000", 'Z': "011001", 'a': "011010", 'b': "011011",
'c': "011100", 'd': "011101", 'e': "011110", 'f': "011111",
'g': "100000", 'h': "100001", 'i': "100010", 'j': "100011",
'k': "100100", 'l': "100101", 'm': "100110", 'n': "100111",
'o': "101000", 'p': "101001", 'q': "101010", 'r': "101011",
's': "101100", 't': "101101", 'u': "101110", 'v': "101111",
'w': "110000", 'x': "110001", 'y': "110010", 'z': "110011",
'0': "110100", '1': "110101", '2': "110110", '3': "110111",
'4': "111000", '5': "111001", '6': "111010", '7': "111011",
'8': "111100", '9': "111101", '+': "111110", '/': "111111",
}
ret = ""
for cc in ss:
if cc == "=":
break
ret += table[cc]
lst = []
idx = 0
while idx + 8 <= len(ret):
lst.append( int(ret[idx:idx+8], base=2) )
idx += 8
assert int(ret[idx:], base=2) == 0, f"ret[idx:]={ret[idx:]}"
ret = ""
for ii, nn in enumerate(lst):
if nn < 0x20 or nn >= 0x7F:
print( f"ii={ii}, nn={nn:02X}" )
else:
ret += chr(nn)
print( f"len(ret)={len(ret)}, ret={ret}" )
base64_decode_manual( "YidkM0JxZGtwQlRYdHFhR3g2YUhsZmF6TnFlVGwzWVROclh6ZzVNR3N5TXpjNWZRPT0nCg==" )
base64_decode_manual( "d3BqdkpBTXtqaGx6aHlfazNqeTl3YTNrXzg5MGsyMzc5fQ" )
å®è¡ãã¦ã¿ã¾ãããªãã»ã©ãæå¾ã® 1æåã¯æ¹è¡ã³ã¼ãã ã£ãããã§ãã
$ python tmp.py
len(ss)=72
ii=51, nn=0A
len(ret)=51, ret=b'd3BqdkpBTXtqaGx6aHlfazNqeTl3YTNrXzg5MGsyMzc5fQ=='
len(ss)=46
len(ret)=34, ret=wpjvJAM{jhlzhy_k3jy9wa3k_890k2379}
ã·ã¼ã¶ã¼æå·
ã·ã¼ã¶ã¼æå·ã®ã¨ããã¯ãå®è£
ãééãã¦ãã¾ãããæ°åã¨è¨å·ã¯ãã®ã¾ã¾ã«ãã¦ããã®ãæ®éãããã§ãã
def str2int( ss, offset=0, num_disable=False ):
lst = []
for cc in ss:
if cc == ' ':
lst.append( ord(cc) )
elif ('0' <= cc <= '9') and not num_disable:
mm = (ord(cc) - ord('0') + offset) % (ord('9') - ord('0') + 1)
lst.append( mm + ord('0') )
elif 'A' <= cc <= 'Z':
mm = (ord(cc) - ord('A') + offset) % (ord('Z') - ord('A') + 1)
lst.append( mm + ord('A') )
elif 'a' <= cc <= 'z':
mm = (ord(cc) - ord('a') + offset) % (ord('z') - ord('a') + 1)
lst.append( mm + ord('a') )
else:
lst.append( ord(cc) )
print( f"str2int={lst}" )
print( f"str2int={[hex(ii) for ii in lst]}" )
return lst
def int2chr( lst ):
ss = ""
lst_ret = []
for ii in lst:
ss += chr(ii)
lst_ret.append( chr(ii) )
print( f"int2chr={ss}" )
return lst_ret
lst = str2int( "wpjvJAM{jhlzhy_k3jy9wa3k_890k2379}", -7, num_disable=True )
lst_ret = int2chr( lst )
å®è¡ãã¾ãã
$ python tmp.py
str2int=[112, 105, 99, 111, 67, 84, 70, 123, 99, 97, 101, 115, 97, 114, 95, 100, 51, 99, 114, 57, 112, 116, 51, 100, 95, 56, 57, 48, 100, 50, 51, 55, 57, 125]
str2int=['0x70', '0x69', '0x63', '0x6f', '0x43', '0x54', '0x46', '0x7b', '0x63', '0x61', '0x65', '0x73', '0x61', '0x72', '0x5f', '0x64', '0x33', '0x63', '0x72', '0x39', '0x70', '0x74', '0x33', '0x64', '0x5f', '0x38', '0x39', '0x30', '0x64', '0x32', '0x33', '0x37', '0x39', '0x7d']
int2chr=picoCTF{caesar_d3cr9pt3d_890d2379}
picoCTF{caesar_d3cr9pt3d_890d2379}
ã§ããã
Custom encryptionï¼100ãã¤ã³ãï¼
Medium ã®åé¡ã§ããæå·åããããã¡ã¤ã«ï¼enc_flagï¼ã¨ãPythonã¹ã¯ãªããï¼custom_encryption.pyï¼ããã¦ã³ãã¼ãã§ãã¾ãã
enc_flag ã®ä¸èº«ã¯ã以ä¸ã§ãã
a = 97
b = 22
cipher is: [151146, 1158786, 1276344, 1360314, 1427490, 1377108, 1074816, 1074816, 386262, 705348, 0, 1393902, 352674, 83970, 1141992, 0, 369468, 1444284, 16794, 1041228, 403056, 453438, 100764, 100764, 285498, 100764, 436644, 856494, 537408, 822906, 436644, 117558, 201528, 285498]
Pythonã¹ã¯ãªããã¯ä»¥ä¸ã§ãã
is_prime(p)
ã¯ãå¼æ°ã§æå®ãã p ããç´ æ°ã ã£ãã True ãè¿ããç´ æ°ãããªãã£ãã False ãè¿ãããã§ãã
randint(a, b)
ã¯ãa <= x <= b
ã®ç¯å²ã§æ´æ°ã®ä¹±æ°ãè¿ãã¾ãã
generator(g, x, p)
ã¯ãg ã xä¹ãã¦ãp ã§å²ã£ãä½ããè¿ãã¾ãã
dynamic_xor_encrypt(plaintext, text_key)
ã¯ãpaintext ãæ«å°¾ããé çªã«åãåºãã¦ãå¤æ°char ã«æ ¼ç´ãã¾ããã«ã¼ãã®ä¸ã§ã¯ãtext_key ãåããé çªã«åãåºãã¦ãå¤æ°key_char ã«æ ¼ç´ãã¾ããå¤æ°char ã¨ãå¤æ°key_char ã XOR ãã¦ãASCIIã³ã¼ãã§æåãä½ããããã¾ã§ä½ã£ããã®ã¨é£çµãã¦ãçµæãè¿ãã¾ãã
encrypt(plaintext, key)
ã¯ãplaintext ãåããé çªã«æåãåãåºãã¦ãæ´æ°ã«ç´ãã¦ãkey 㨠311 ãããã¦ãªã¹ãã«æ ¼ç´ãã¦ããããã®ãªã¹ããè¿ãã¾ãã
from random import randint
import sys
def generator(g, x, p):
return pow(g, x) % p
def encrypt(plaintext, key):
cipher = []
for char in plaintext:
cipher.append(((ord(char) * key*311)))
return cipher
def is_prime(p):
v = 0
for i in range(2, p + 1):
if p % i == 0:
v = v + 1
if v > 1:
return False
else:
return True
def dynamic_xor_encrypt(plaintext, text_key):
cipher_text = ""
key_length = len(text_key)
for i, char in enumerate(plaintext[::-1]):
key_char = text_key[i % key_length]
encrypted_char = chr(ord(char) ^ ord(key_char))
cipher_text += encrypted_char
return cipher_text
def test(plain_text, text_key):
p = 97
g = 31
if not is_prime(p) and not is_prime(g):
print("Enter prime numbers")
return
a = randint(p-10, p)
b = randint(g-10, g)
print(f"a = {a}")
print(f"b = {b}")
u = generator(g, a, p)
v = generator(g, b, p)
key = generator(v, a, p)
b_key = generator(u, b, p)
shared_key = None
if key == b_key:
shared_key = key
else:
print("Invalid key")
return
semi_cipher = dynamic_xor_encrypt(plain_text, text_key)
cipher = encrypt(semi_cipher, shared_key)
print(f'cipher is: {cipher}')
if __name__ == "__main__":
message = sys.argv[1]
test(message, "trudeau")
復å·ãã¦ãplain_text ãå¾ãããã°ããããã§ãããenc_flag ã«ã¯ aãbãcipher ããããpãg ã¯åºå®å¤ã§ãtext_key ãåºå®ã®æååã§ãã
æç´ã«ããã¨ããã¨ãencrypté¢æ°ã®éã®åãããã decrypté¢æ°ãå®è£
ãã¾ããshared_key 㯠aãb ã¨åºå®å¤ã§æ±ã¾ããããªã®ã§ãdecrypté¢æ°ãå®è¡ã§ãããã§ããçµæã¨ãã¦ãsemi_cipher ãæ±ã¾ãã¾ãã
次ã¯ãdynamic_xor_encrypté¢æ°ã®éã®åãããã dynamic_xor_decrypté¢æ°ãå®è£
ãã¾ããã¾ããä½ã¨ãã§ããããªæ°ããã¾ãããã㧠plain_text ãå¾ããããã§ãã
ãã®ããæ¹ã§ãããã§ããããã100ãã¤ã³ããªã®ã§ãããã¾ã§ã²ãã£ãåé¡ã§ã¯ãªãããªãã¨æãã¾ãããã§ã¯å®è£
ãã¦ããã¾ãã
from random import randint
import sys
def generator(g, x, p):
return pow(g, x) % p
def decrypt(cipher, key):
plaintext = []
for ii, num in enumerate(cipher):
assert num % (key * 311) == 0, f"fatal: ii={ii}, num={num}"
tmp = num // key // 311
plaintext.append( chr(tmp) )
return ''.join( plaintext )
def dynamic_xor_decrypt(semi_cipher, text_key):
plain_text = ""
key_length = len(text_key)
for ii, cc in enumerate(semi_cipher):
key_char = text_key[ii % key_length]
decrypted_char = chr( ord(cc) ^ ord(key_char) )
plain_text += decrypted_char
return plain_text[::-1]
if __name__ == "__main__":
cipher = [151146, 1158786, 1276344, 1360314, 1427490, 1377108, 1074816, 1074816, 386262, 705348, 0, 1393902, 352674, 83970, 1141992, 0, 369468, 1444284, 16794, 1041228, 403056, 453438, 100764, 100764, 285498, 100764, 436644, 856494, 537408, 822906, 436644, 117558, 201528, 285498]
p = 97
g = 31
a = 97
b = 22
u = generator(g, a, p)
v = generator(g, b, p)
key = generator(v, a, p)
b_key = generator(u, b, p)
shared_key = None
if key == b_key:
shared_key = key
else:
raise
print( f"shared_key={shared_key}" )
semi_cipher = decrypt( cipher, shared_key )
print( f"semi_cipher={semi_cipher}" )
plain_text = dynamic_xor_decrypt(semi_cipher, "trudeau")
print( f"plain_text={plain_text}" )
å®è¡ãã¾ããããåºæ¥ã¾ããã
$ python tmp.py
shared_key=54
semi_cipher= ELQUR@@*SDV>3 1
plain_text=picoCTF{custom_d2cr0pt6d_e4530597}
picoCTF{custom_d2cr0pt6d_e4530597}
ã§ããã
C3ï¼200ãã¤ã³ãï¼
Medium ã®åé¡ã§ããæå·æã®ãã¡ã¤ã«ï¼ciphertextï¼ã¨ãã¨ã³ã³ã¼ãã® Pythonã¹ã¯ãªããï¼convert.pyï¼ããã¦ã³ãã¼ãã§ãã¾ãã
ã¾ããæå·æããè¦ã¦ã¿ã¾ããã ãã¶é·ãã§ãã
DLSeGAGDgBNJDQJDCFSFnRBIDjgHoDFCFtHDgJpiHtGDmMAQFnRBJKkBAsTMrsPSDDnEFCFtIbEDtDCIbFCFtHTJDKerFldbFObFCFtLBFkBAAAPFnRBJGEkerFlcPgKkImHnIlATJDKbTbFOkdNnsgbnJRMFnRBNAFkBAAAbrcbTKAkOgFpOgFpOpkBAAAAAAAiClFGIPFnRBaKliCgClFGtIBAAAAAAAOgGEkImHnIl
次ã«ã¨ã³ã³ã¼ãã® Pythonã¹ã¯ãªãããè¦ã¦ã¿ã¾ãã
æåã«æ¨æºå
¥åããæ¹è¡æåå«ãã¦ãè¤æ°è¡ã®æååãåãåããchars ã«æ ¼ç´ãã¾ãã
chars ãåããé çªã« 1æåãã¤åãåºãã¦ãlookup1 ã®ä¸ã§ä¸è´ããæåã®ã¤ã³ããã¯ã¹ãåå¾ãã¾ããã¡ãªã¿ã«ãindexé¢æ°ã¯è¦ã¤ãããªãã£ãå ´å㯠-1 ãè¿ãã¾ãããããããç¶æ³ããã£ã¦ãåãããã§ãã
ãã®ã¤ã³ããã¯ã¹ãã prevï¼ååå¤ï¼ãå¼ãã¦ã40 ã§å²ã£ãä½ãã out ã«æ ¼ç´ãã¦ããã¾ããã¡ãªã¿ã«ãlookup1 㨠lookup2 ã¯ã¨ãã« 40æåã§ãã
æå¾ã« out ãæ¨æºåºåã«åºåãã¾ãã
import sys
chars = ""
from fileinput import input
for line in input():
chars += line
lookup1 = "\n \"#()*+/1:=[]abcdefghijklmnopqrstuvwxyz"
lookup2 = "ABCDEFGHIJKLMNOPQRSTabcdefghijklmnopqrst"
out = ""
prev = 0
for char in chars:
cur = lookup1.index(char)
out += lookup2[(cur - prev) % 40]
prev = cur
sys.stdout.write(out)
åé¡æã«ã¯æ確ã«æ¸ããã¦ã¾ããã§ãããããã³ã¼ãã¼ãå®è£
ããã°ãããã§ãããããå
ã»ã©ã®ãCustom encryptionãããç°¡åã«è¦ãã¾ãããååå¤ã¨ããã®ãããã®ã§ãå®ã¯ãã£ããããããã¾ããã
æå·æï¼ciphertextï¼ã¯ã237æåããã¾ããã¨ãããã¨ã¯ãå
¥åã 237æåã ã£ãã¨ãããã¨ã«ãªãã¾ããã¾ãã1æåç®ãå
¥åããã¦ãcur ã« 0 ãã 39 ã¾ã§ã®å¤ãå
¥ããlookup2 ãã cur ã®ã¤ã³ããã¯ã¹ã§æåãæ½åºããã¨ãD
ã ã£ãã¨ãããã¨ã§ããã¨ãããã¨ã¯ãcur 㯠3 ã ã£ãã®ã§ãå
¥å㯠#
ã ã£ãã¨ãããã¨ã«ãªãã¾ããprev ã«ã¯ 3 ãå
¥ãã¾ãããã¼ããåããããã°åºæ¥ãããããªãã§ããããã
ã§ã¯å®è£
ãã¦ããã¾ãã
import sys
chars = ""
from fileinput import input
for line in input():
chars += line
lookup1 = "\n \"#()*+/1:=[]abcdefghijklmnopqrstuvwxyz"
lookup2 = "ABCDEFGHIJKLMNOPQRSTabcdefghijklmnopqrst"
prev = 0
out = ""
for ii, cc in enumerate(chars):
cur = lookup2.index( cc )
out += lookup1[(cur + prev) % 40]
prev = cur + prev
sys.stdout.write(out)
å®è¡ãã¾ãããªããã½ã¼ã¹ã³ã¼ããåºã¦ãã¾ããããªãã»ã©ããªãã¤ã¬ã¯ããã¦ã½ã¼ã¹ï¼tmp2.pyï¼ã«è½ã¨ãã¾ãã
$ python tmp.py < ../picoCTF/picoCTF2024_Cryptography/C3/ciphertext > tmp2.py
chars = ""
from fileinput import input
for line in input():
chars += line
b = 1 / 1
for i in range(len(chars)):
if i == b * b * b:
print chars[i]
b += 1 / 1
ã§ã¯ãä»åº¦ã¯ãtmp2.py ãå®è¡ãã¦ã¿ã¾ããããPython2 ãªã®ã§ãprint ã®ã¨ããã ãç´ãã¦å®è¡ãã¾ããã§ããä½ãå
¥åããã°ããã®ã§ãããããã³ã¡ã³ããè¦ãã¨ãã¢ã¹ãã¼é ã« 40æåãå
¥åããã¨ãããã¨ã§ããããã
ã¢ã¹ãã¼é ã¯ãã©ãããå
¥åãããã§ãããããã¨ãããããè±æåã«éå®ãã¦å
¥åãã¦ã¿ã¾ããããã¡ã§ãããã¹ãã¼ã¹ ãã G ã¾ã§å
¥åãããã¡ã¤ã«ãå
¥åãã¦ã¿ã¾ããããã¡ã§ããã
$ echo -n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn' | python tmp2.py
b=1.0, len(chars)=40
B
I
b
åããã¾ãããèãã¦ãåãããªããããªã®ã§ã®ãã¢ããã§ãã
writeupãè¦ãã¨ããã® tmp2.py èªä½ãå
¥åããã¨ãããã¨ã¿ããã§ããselfinput ã¨ã¯ãããããæå³ãªãã§ããããªãã»ã©ãwriteup ãæ¸ããã人ããã¨ã¹ãã¼æåãçµæ§ãããã¨æ¸ããã¦ãã¾ããããæ©ãã«ã®ãã¢ãããã¦è¯ãã£ãã§ãã
Python2 ã®ç°å¢ã¯ç¡ãã®ã§ãPython3 ã«æ¸ãç´ãããã®ã¨å¥ã«ã½ã¼ã¹ãã¡ã¤ã«ãç¨æãã¾ãã
$ python tmp.py < ../picoCTF/picoCTF2024_Cryptography/C3/ciphertext > tmp3.py
$ python tmp2.py < tmp3.py
b=1.0, len(chars)=237
a
d
l
i
b
s
picoCTF{adlibs}
ã§ããã
rsa_oracleï¼300ãã¤ã³ãï¼
Medium ã®åé¡ã§ããæå·æã®ãã¡ã¤ã«ï¼secret.encï¼ã¨ããã¹ã¯ã¼ãã®ãã¡ã¤ã«ï¼password.encï¼ããã¦ã³ãã¼ãã§ãã¾ããã¾ãããµã¼ããèµ·åã§ããããã§ãã
æå·æã®ãã¡ã¤ã«ã¨ãã¹ã¯ã¼ãã®ãã¡ã¤ã«ã確èªãã¾ããæå·æ㯠64byte ã®ãã¤ããªãã¡ã¤ã«ã§ããã¹ã¯ã¼ã㯠154æåã§ããã
$ hexdump -C secret.enc
00000000 53 61 6c 74 65 64 5f 5f 67 d6 dd c5 30 27 20 5e |Salted__g...0' ^|
00000010 e9 ba 04 09 6c 01 f4 9e 68 06 93 a3 0e 69 ba 9f |....l...h....i..|
00000020 b3 70 18 32 ce 88 99 3f b7 4c 63 7d 35 0f da a7 |.p.2...?.Lc}5...|
00000030 a9 ed 48 82 7c 55 56 3b f5 fc 68 40 e3 3d b3 ea |..H.|UV;..h@.=..|
00000040
$ cat password.enc
2575135950983117315234568522857995277662113128076071837763492069763989760018604733813265929772245292223046288098298720343542517375538185662305577375746934
ãµã¼ããèµ·åãã¦ã¿ã¾ããE ã D ãå
¥åããã¨æå·åã¨å¾©å·ããã£ã¦ãããããã§ããæå·åã¯åºæ¥ã¦ãããã«è¦ãã¾ããããã¹ã¯ã¼ããå
¥ãã¦ã復å·ããã¾ãããããç¬ããã試ã¿ã§ããã解èªã¯ç¡çã§ãããåµé åãçºæ®ãã¦é å¼µã£ã¦ãã ãããã¨ç¬ããã¾ããï¼ç¬ï¼ã
$ nc titan.picoctf.net 54320
*****************************************
****************THE ORACLE***************
*****************************************
what should we do for you?
E --> encrypt D --> decrypt.
E
enter text to encrypt (encoded length must be less than keysize): aaa
aaa
encoded cleartext as Hex m: 616161
ciphertext (m ^ e mod n) 4443234402154812773385501834340003636914383861160506214643463504676790998210270710730017166210361998872964038946757473353651450587613192159232519828813975
what should we do for you?
E --> encrypt D --> decrypt.
D
Enter text to decrypt: 2575135950983117315234568522857995277662113128076071837763492069763989760018604733813265929772245292223046288098298720343542517375538185662305577375746934
Lol, good try, can't decrypt that for you. Be creative and good luck
what should we do for you?
E --> encrypt D --> decrypt.
^C
ã¡ãã£ã¨ãããããã©ããã¦ãããåããã¾ãããã®ãã¢ããã§ããCrypto ã¯ãä»ã¯ãåæ©çãªåé¡ããåºæ¥ãªãããã§ãã
flag_printerï¼500ãã¤ã³ãï¼
ã¾ã 解ããæ°ãããªãã®ã§ãå¾æ¥ã«ãã¾ãã
ããã§ãCryptography ã¯çµäºã§ãã
ãããã«
ä»åã¯ãpicoCTF ã® picoCTF 2024 ã®ãã¡ãCryptography ã¨ããã«ãã´ãªã®å
¨5åã«ææ¦ãã¾ããããã¨ã¦ãé£ããã£ãã§ããããã§ãä¸éããpicoCTF 2024 ã¯ãã£ã¦ã¿ãæãã§ããã¾ã ã¾ã ãå
¨ç¶ã§ãããé å¼µãã¾ãã
æå¾ã«ãªãã¾ããããã¨ã³ã¸ãã¢ã°ã«ã¼ãã®ã©ã³ãã³ã°ã«åå ä¸ã§ãã
æ°æ¥½ã«ãããã¨ãããããé¡ããããã¾ãð
ä»åã¯ä»¥ä¸ã§ãï¼
æå¾ã¾ã§ãèªã¿ããã ãããããã¨ããããã¾ããã