Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- # from secretkey import secret_func
- from math import *
- def f(x):
- # return -(127 * (math.log(3 * math.cos(x / 2) - 2 * math.sin(x / 2)) - log(3 * math.sin(x / 2) + 2 * math.cos(x / 2)))) / math.pi
- return -127 * log(-tan(x / 2 - atan2(3, 2))) / pi
- def s(f, x):
- return (f(x + 0.001) - f(x)) / 0.001
- def encrypt(f, a, m):
- y0 = f(a)
- y1 = f(m)
- s0 = s(f, a)
- s1 = s(f, m)
- if s0 == s1: return "NULL"
- x = (y1-y0 + s0*a - s1*m)/(s0-s1)
- return (x, s1*(x-m) + y1)
- a = -9/4 * math.pi
- # l = input("What is the message? ")
- # for c in map(ord, l):
- # print(encrypt(secret_func, a, c))
- print(f(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement