using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Security.Cryptography; using System.IO;
namespaceConsoleApp1 { classProgram { publicstaticstringGenerateMd5(string text) { string result; using (MD5 md = MD5.Create()) { byte[] bytes = Encoding.Default.GetBytes(text); byte[] array = md.ComputeHash(bytes); StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < array.Length; i++) { stringBuilder.Append(array[i].ToString("x2")); } result = stringBuilder.ToString(); } return result; }
publicstaticstringDesDecrypt(string key, string iv) { byte[] bytes = Encoding.UTF8.GetBytes(key); byte[] bytes2 = Encoding.UTF8.GetBytes(iv); string s = "eqwLr9Qh7qNMVaNd78tRy1tUdJa4eG48C9vIB+FVPTcjDf+RKofGrA=="; DESCryptoServiceProvider descryptoServiceProvider = new DESCryptoServiceProvider(); string result; using (MemoryStream memoryStream = new MemoryStream()) { byte[] array = Convert.FromBase64String(s); try { using (CryptoStream cryptoStream = new CryptoStream(memoryStream, descryptoServiceProvider.CreateDecryptor(bytes, bytes2), CryptoStreamMode.Write)) { cryptoStream.Write(array, 0, array.Length); cryptoStream.FlushFinalBlock(); } result = Encoding.UTF8.GetString(memoryStream.ToArray()); } catch { result = "Oho!You are caught by me!"; } } return result; }
defb(i): if i[:8] != "TSCTF-J{": returnFalse if i[-1:] != "}": returnFalse returnTrue
defc(i): l = a(i) b = [] for j in range(l): print(i[j]) i[j] = (i[j] + 128) % 256 return bytes(i)
defe(f): o = [] l = a(f) for i in range(l): w = ord(f[i]) ^ ord(f[(i+4)%l]) o.append(w) return c(o)
defmain(): s = input("Guess\n>>") o = b'\xa9\x9a\xbf\xb6\x90\xea\x9f\xb1\xd9\xec\x8a\xa0\x80\x9a\xa6\x8a\xd8\x89\xbe\xca\xbe\xb7\xab\x9e\x94\xaf\x89\xfe\x92' if e(s) == o and b(s): print("Correct") else: print("Wrong...")
#!/usr/bin/env python3 from secret import flag, secret_number_you_never_know
print("Source code:") with open("main.py") as f: print(f.read())
print("") try: val = 0 inp = input("Input value: ") count_digits = len(set(inp)) if count_digits <= 10: val = eval(inp) else: raise
if val == secret_number_you_never_know: # I am very sure it is a int print(flag) else: print("Nope. Better luck next time.") except: print("Nope. No hacking.") exit(1)
defc(i): l = a(i) for j in range(l): i[j] = (ord(i[j]) + 128) % 256 else: return bytes(i)[::-1]
defe(f): l = a(f) w = list(f) for i in range(l): w[i] = chr(ord(w[i]) ^ ord(w[((i + 4) % l)])) # 这里和easyAsm不同,把加密后的立刻赋值到第一位 else: return c(w)
defmain(): s = input('Guess?\n>> ') o = b'\xd2\xa8\xba\xa2\x92\xe6\x9b\xe3\xc8\xb3\xeb\xbb\xf3\xd5\xc3\xd8\x83\xda\xbd\x9d\x91\xaf\x89\xfe\x92' if e(s) == o: print('Correct!') else: print('Wrong...')