Finding Flags
더보기
crypto{y0ur_f1rst_fl4g}
Great Snakes
#!/usr/bin/env python3
import sys
# import this
if sys.version_info.major == 2:
print("You are running Python 2, which is no longer supported. Please update to Python 3.")
ords = [81, 64, 75, 66, 70, 93, 73, 72, 1, 92, 109, 2, 84, 109, 66, 75, 70, 90, 2, 92, 79]
print("Here is your flag:")
print("".join(chr(o ^ 0x32) for o in ords))
더보기
crypto{z3n_0f_pyth0n}
ASCII
a = [99, 114, 121, 112, 116, 111, 123, 65, 83, 67, 73, 73, 95, 112, 114, 49, 110, 116, 52, 98, 108, 51, 125]
result = ''
for i in range(0, len(a)):
result += chr(a[i])
print(result)
더보기
crypto{ASCII_pr1nt4bl3}
Hex
a ='63727970746f7b596f755f77696c6c5f62655f776f726b696e675f776974685f6865785f737472696e67735f615f6c6f747d'
a = bytes.fromhex(a)
print(a)
더보기
crypto{You_will_be_working_with_hex_strings_a_lot}
Base64
import base64
a = '72bca9b68fc16ac7beeb8f849dca1d8a783e8acf9679bf9269f7bf'
a = base64.b64encode(bytes.fromhex(a))
print(a)
더보기
crypto/Base+64+Encoding+is+Web+Safe
Bytes and Big Integers
from Crypto.Util.number import *
a = 11515195063862318899931685488813747395775516287289682636499965282714637259206269
a = long_to_bytes(a)
print(a)
더보기
crypto{3nc0d1n6_4ll_7h3_w4y_d0wn}
XOR Starter
a = "label"
result = ''
for c in a:
result += chr(ord(c) ^ 13)
print(result)
더보기
cypto{aloha}
XOR Properties
from Crypto.Util.number import *
import binascii
k1 = "a6c8b6733c9b22de7bc0253266a3867df55acde8635e19c73313"
k2_k1 = "37dcb292030faa90d07eec17e3b1c6d8daf94c35d4c9191a5e1e"
k2_k3 = "c1545756687e7573db23aa1c3452a098b71a7fbf0fddddde5fc1"
flag_k1_k3_k2 = "04ee9855208a2cd59091d04767ae47963170d1660df7f56f5faf"
result = long_to_bytes(bytes_to_long(binascii.unhexlify(flag_k1_k3_k2)) ^ bytes_to_long(binascii.unhexlify(k1)) ^ bytes_to_long(binascii.unhexlify(k2_k3)))
print(result)
더보기
crypto{x0r_i5_ass0c1at1v3}
Favourite byte
import binascii
a = '73626960647f6b206821204f21254f7d694f7624662065622127234f726927756d'
result=''
a = binascii.unhexlify(a)
for c in a:
result += chr(c^(a[0]^ord('c')))
print(result)
더보기
crypto{0x10_15_my_f4v0ur173_by7e}
You either know, XOR you don't
import binascii
from Crypto.Util.strxor import *
a = '0e0b213f26041e480b26217f27342e175d0e070a3c5b103e2526217f27342e175d0e077e263451150104'
key=''
result =''
# key 획득 및 유추
a = binascii.unhexlify(a)
key = strxor((a[:7]), b'crypto{')
# xor 연산
key = list('myXORkey')
for i in range(len(a)):
result += chr(a[i] ^ ord(key[i%8]))
print(result)
더보기
crypto{1f_y0u_Kn0w_En0uGH_y0u_Kn0w_1t_4ll}
'Challenge > CRYPTOHACK' 카테고리의 다른 글
[CRYPTOHACK] MODULAR ARITHMETIC (0) | 2022.03.31 |
---|