hui awavmiis hqklse mx o gvslfr tn zrqecuhcef ecdmiwihvg ysrk ac lgnvb e grvnsm fe mehjzrsjrr hoyjzv twupzvg oexsx fm xys qmoxsew tt u bdcncwl. dx wf e kcld nj gcqgvpduegsnzb wlpxbdxigmtb. zczk zg mmgpc_imlshvqi
It's Vigenere cipher.
Key is: ONEFOURZEROFIVE
Cleartext is:
the vigenere cipher is a method of encrypting alphabetic text by using a series of interwoven caesar ciphers based on the letters of a keyword. it is a form of polyalphabetic substitution. flag is hello_vigenere
if True: enc_data = SECRET_LOGIC() enc = powmod(enc_data, e, n) conn.send("enc : %d\ne : %d\np : %d\nq : %d\n" % (enc, e, p, q)) recv = conn.recv(1024) if end - start > 1: conn.send("time out") conn.close() if recv == enc_data: conn.send(FLAG) conn.close() conn.send("wrong") conn.close()else: conn.close() print "error"
I wrote a ruby script to solve this RSA:
#!/usr/bin/rubyrequire 'socket'require 'openssl'require 'base64'# Source of int2Text: http://stackoverflow.com/questions/42993763/how-to-convert-bytes-in-number-into-a-string-of-characters-character-represent#42999986defint2Text(int) a = []while int>0 a << (int &0xFF) int >>=8endreturn a.reverse.pack('C*')end# Source of egcd: https://gist.github.com/jsanders/6735046defegcd(a, b) u_a, v_a, u_b, v_b = [ 1, 0, 0, 1 ]while a !=0 q = b / a a, b = [ b - q*a, a ] u_a, v_a, u_b, v_b = [ u_b - q*u_a, v_b - q*v_a, u_a, v_a ]# Each time, `u_a*a' + v_a*b' = a` and `u_b*a' + v_b*b' = b`end [ b, u_b, v_b ]enddefmodinv(a, m) g, x, y = egcd(a, m)if g !=1raise'modular inverse does not exist'elsereturn x % mendend# Server connectionhostname ='203.251.182.94'port =4000s =TCPSocket.open(hostname, port)raw =''answer_sent =falsewhile line = s.gets# Read lines from the socketputs line.chop# And print with platform line terminator raw += lineif raw.match(/q :/) && answer_sent ==false c = raw.match(/^enc : ([0-9]*)$/).captures[0].to_i e = raw.match(/^e : ([0-9]*)$/).captures[0].to_i p_int = raw.match(/^p : ([0-9]*)$/).captures[0].to_i q = raw.match(/^q : ([0-9]*)$/).captures[0].to_i phi = (p_int -1) * (q -1) d = modinv(e, phi) n = p_int*q# more efficient than m_int = (c ** d) % n m_int = c.to_bn.mod_exp(d, n).to_i# cleartext is base64 containing an integer m_b64 = int2Text(m_int)puts"base64 : #{m_b64}" m =Base64.decode64(m_b64)puts"int : #{m}"# integer must be transform to text again m_text = int2Text(m.to_i)puts"text : #{m_text}" s.puts m_text answer_sent =trueendends.close # Close the socket when done
50 - Instead of 5 billion won, I give you a cute handcuffs - Misc#
In the fall of 2016, an e-mail arrived to detective Kim, who is tracking up economic fugitives who have shed large amounts of money from a large corporation.
I know the location of the perpetrator, but I can not tell you, and if you pay me 5 billion, I was attached with a photograph that would tell you the exact location.
The attached photo was taken nearest to his refuge.
Can Kim find out where the shooter escaped?
(The correct answer is the address in Korea. Example: 52-3, Yeonsan-dong, Yeonje-gu, Busan, Republic of Korea)
$ exiftool 1.JPG | grep -i gpsGPS Latitude Ref : NorthGPS Longitude Ref : EastGPS Altitude Ref : Above Sea LevelGPS Time Stamp : 04:50:51GPS Speed Ref : km/hGPS Speed : 0GPS Img Direction Ref : True NorthGPS Img Direction : 115.244898GPS Dest Bearing Ref : True NorthGPS Dest Bearing : 115.244898GPS Date Stamp : 2016:11:06GPS Horizontal Positioning Error: 10 mGPS Altitude : 95.3 m Above Sea LevelGPS Date/Time : 2016:11:06 04:50:51ZGPS Latitude : 37 deg 40' 11.91" NGPS Longitude : 127 deg 0' 29.88" EGPS Position : 37 deg 40' 11.91" N, 127 deg 0' 29.88" E
Google Maps sucks: DEG40, 94551, Deggendorf, Niederbayern, Bayern, Allemagne
findlatitudeandlongitude.com works better: 238-1 Ui-dong, Gangbuk-gu, Seoul, South Korea but we need to respect description format: 238-1, Ui-dong, Gangbuk-gu, Seoul, Republic of Korea.