-
Notifications
You must be signed in to change notification settings - Fork 0
/
reverseEquation.py
22 lines (21 loc) · 1.23 KB
/
reverseEquation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# !python3
from math import *
from decimal import Decimal
#the commented enc in challenge.py file
enc=[69949.90776101458, 1.0186915887850467, 69949.90876951923, 1.0196078431372548, 69949.90352371817, 1.0277777777777777, 69949.90614710683, 1.017094017094017, 69949.90594534237, 1.0186915887850467, 69949.90473463427, 1.017391304347826, 69949.90715584248, 1.018181818181818, 69949.90614710683, 1.024390243902439, 69949.90917288068, 1.0208333333333333, 69949.90534001432, 1.04, 69949.90917288068, 1.02, 69949.90876951923, 1.0175438596491229, 69949.90392737999, 1.0212765957446808, 69949.90574357212, 1.02, 69949.90876951923, 1.0175438596491229, 69949.90392737999, 1.0212765957446808, 69981.0168870452, 1.0212765957446808, 69949.90513822675, 1.0178571428571428, 69949.90473463427, 1.0192307692307692, 69949.90372555197, 1.0166666666666666, 69949.90312003322, 1.2222222222222223]
# Decimal(enc1)
def get_val(enc_number,i):
if (i%2==0):
x = (984512/(Decimal(enc_number)-69964))+69964
letter = chr(round(x))
return letter
else:
y = (Decimal(enc_number)+1)/(Decimal(enc_number)-1)
letter = chr(round(y))
return letter
flag = ''
i= 0
for L in enc:
flag+=get_val(L,i)
i+=1
print("Final TEST >>",flag)