lignite

perceive encryption, much faster than 3-Diffie reference

Aug 8th, 2017
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 21.26 KB | None | 0 0
  1. """
  2. Perceive Cryptography Algorythm In Python 2.7
  3. Perform a series of Diffie-Hellman exchanges to
  4. perceive a common data point without communicating it
  5. then use this data point as the modulo for encryption,
  6. signing, establishment of SSL-like channels via shared
  7. Pseudeo-random Number Generation, and exploration of
  8. periodic elements [with a grain of salt]
  9.  
  10. This Software Is Licensed As Sharia Law
  11. """
  12. import hashlib
  13. import random
  14. from binascii import hexlify # For debug output
  15. import json
  16. import sys
  17.  
  18. # If a secure random number generator is unavailable, exit with an error.
  19. try:
  20.     import ssl
  21.     random_function = ssl.RAND_bytes
  22.     random_provider = "Python SSL"
  23. except (AttributeError, ImportError):
  24.     import OpenSSL
  25.     random_function = OpenSSL.rand.bytes
  26.     random_provider = "OpenSSL"
  27.  
  28. def xor(data, key):
  29.     return bytearray(a^b for a, b in zip(*map(bytearray, [data, key])))
  30.  
  31. def quad(a, x, b, c):
  32.     blocksize = x.bit_length() // 8 + 1
  33.     blocks = [a[i:i+blocksize] for i in range(0, len(a), blocksize)]
  34.     y = bytearray()
  35.     pseudo = pow(x, b, c)
  36.     for i in range(len(blocks)):
  37.         pseudo = pow(pseudo, b, c)
  38.         y += xor(blocks[i], to_bytes(pseudo, pseudo.bit_length() // 8 + 1, byteorder="big"))
  39.     return y
  40.  
  41. def to_bytes(n, length, byteorder="big"):
  42.     h = '%x' %n
  43.     s = ('0'*(len(h) % 2) + h).zfill(length*2).decode('hex')
  44.     return s if byteorder =='big' else s[::-1]
  45.  
  46. class DiffieHellman(object):
  47.     """
  48.   A reference implementation of the Diffie-Hellman protocol.
  49.   By default, this class uses 1536-bit MODP Group From RFC3526.
  50.   """
  51.  
  52.     def __init__(self, privateKey=None, keyLength=2048):
  53.         """
  54.       Generate the public and private keys.
  55.       """
  56.         min_keyLength = 180
  57.         self.diffie_base = 481 # base g from Diffie's protocol
  58.         self.starter_base    = 5
  59.         self.starter_prime   = 733
  60.         self.__fingerprint   = None
  61.         self.__secret        = random.randint(1,sys.maxint)
  62.         self.__g_po          = None
  63.         self.__g_pO          = None
  64.         self.__g_Po          = None
  65.         self.__ephemeralKey  = None
  66.         self.__initiator     = True
  67.         self.publicKey       = None
  68.  
  69.         if(keyLength < min_keyLength):
  70.             print("Error: keyLength is too small. Setting to minimum.")
  71.             self.keyLength = min_keyLength
  72.         else:
  73.             self.keyLength = keyLength
  74.  
  75.         # RFC3526 1536-bit MODP Group
  76.         self.prime = int('0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC7'
  77.                          '4020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437'
  78.                          '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDE'
  79.                          'E386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598'
  80.                          'DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED'
  81.                          '529077096966D670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF', 16)
  82.  
  83.         if privateKey is None:
  84.             self.privateKey = self.genPrivateKey(keyLength)
  85.         else:
  86.             self.privateKey = privateKey
  87.         self.publicKey = self.genPublicKey() # regenerate this after establishBase()
  88.  
  89.     def establishBase(self, challenge=None):
  90.         if challenge is None:
  91.             return pow(self.starter_base, self.__secret, self.starter_prime)
  92.         else:
  93.             self.diffie_base = pow(challenge, self.__secret, self.starter_prime)
  94.             self.genPublicKey() # regenerate public key after changing base
  95.  
  96.     def genPrivateKey(self, bits):
  97.         """
  98.       Generate a private key using a secure random number generator.
  99.       """
  100.         return self.genRandom(bits)
  101.  
  102.     def genPublicKey(self):
  103.         """
  104.       Generate a public key X with g**x % p.
  105.       """
  106.         return pow(self.diffie_base, self.privateKey, self.prime)
  107.  
  108.     def genRandom(self, bits):
  109.         """
  110.       Generate a random number with the specified number of bits
  111.       """
  112.         _rand = 0
  113.         _bytes = bits // 8 + 8
  114.  
  115.         while(_rand.bit_length() < bits):
  116.             try:
  117.                 # Python 3
  118.                 _rand = int.from_bytes(random_function(_bytes), byteorder='big')
  119.             except:
  120.                 # Python 2
  121.                 _rand = int(OpenSSL.rand.bytes(_bytes).encode('hex'), 16)
  122.  
  123.         return _rand
  124.  
  125.     def genKey(self, otherKey):
  126.         """
  127.       Derive the shared secret, then hash it to obtain the shared key.
  128.       """
  129.         self.sharedSecret = self.genSecret(self.privateKey, otherKey)
  130.  
  131.         # Convert the shared secret (int) to an array of bytes in network order
  132.         # Otherwise hashlib can't hash it.
  133.         try:
  134.             _sharedSecretBytes = self.sharedSecret.to_bytes(self.sharedSecret.bit_length() // 8 + 1, byteorder="big")
  135.         except AttributeError:
  136.             _sharedSecretBytes = str(self.sharedSecret)
  137.  
  138.         s = hashlib.sha256()
  139.         s.update(bytes(_sharedSecretBytes))
  140.         self.key = s.digest()
  141.  
  142.     def checkPublicKey(self, otherKey):
  143.         """
  144.       Check the other party's public key to make sure it's valid.
  145.       Since a safe prime is used, verify that the Legendre symbol == 1
  146.       """
  147.         if(otherKey > 2 and otherKey < self.prime - 1):
  148.             if(pow(otherKey, (self.prime - 1)//2, self.prime) == 1):
  149.                 return True
  150.         return False
  151.  
  152.     def genSecret(self, privateKey, otherKey):
  153.         """
  154.       Check to make sure the public key is valid, then combine it with the
  155.       private key to generate a shared secret.
  156.       """
  157.         if(self.checkPublicKey(otherKey) == True):
  158.             sharedSecret = pow(otherKey, privateKey, self.prime)
  159.             return sharedSecret
  160.         else:
  161.             raise Exception("Invalid public key.")
  162.  
  163.     def showParams(self):
  164.         """
  165.       Show the parameters of the Diffie Hellman agreement.
  166.       """
  167.         print("Parameters:")
  168.         print("Prime[{0}]: {1}".format(self.prime.bit_length(), self.prime))
  169.         print("Private key[{0}]: {1}\n".format(self.privateKey.bit_length(), self.privateKey))
  170.         print("Public key[{0}]: {1}".format(self.publicKey.bit_length(), self.publicKey))
  171.  
  172.     def showResults(self):
  173.         """
  174.       Show the results of a Diffie-Hellman exchange.
  175.       """
  176.         print("Results:")
  177.         print("Shared secret[{0}]: {1}".format(self.sharedSecret.bit_length(), self.sharedSecret))
  178.         print("Shared key[{0}]: {1}".format(len(self.key), hexlify(self.key)))
  179.  
  180.     def getKey(self):
  181.         """
  182.       Return the shared secret key
  183.       """
  184.         return self.key
  185.  
  186.     def get_fingerprint(self):
  187.         if self.__fingerprint:
  188.             return self.__fingerprint
  189.  
  190.         publicKey = self.publicKey
  191.         return self.__make_fingerprint(publicKey)
  192.  
  193.     def __make_fingerprint(self, pub_key):
  194.         self.__fingerprint = self.__hash(pub_key)
  195.         return self.__fingerprint
  196.  
  197.     def __hash(self, *values):
  198.         """Hashes the concatenation of values
  199.       each element in values must be of type int
  200.       """
  201.         s = hashlib.sha256()
  202.         for value in values:
  203.             try:
  204.                 value_bytes = to_bytes(value, value.bit_length() // 8 + 1, byteorder="big")
  205.             except AttributeError:
  206.                 value_bytes = str(value)
  207.  
  208.             s.update(bytes(value_bytes))
  209.         return s.digest()
  210.  
  211.     def establishAccord(self, party_ephemeral, party_signature=None):
  212.         if party_signature is not None:
  213.            self.handshake(party_ephemeral, party_signature)
  214.  
  215.     def getEphemeralPublicKey(self):
  216.         return self.__ephemeralKey.publicKey
  217.  
  218.     def establishEphemeralListener(self):
  219.         self.__ephemeralKey = DiffieHellman()
  220.         self.__initiator = False
  221.  
  222.     def handshake(self, party_ephemeral, party_signature):
  223.         if self.__initiator:
  224.             self.__ephemeralKey = DiffieHellman()
  225.         fingerprint = self.__make_fingerprint(party_signature)
  226.         self.__ephemeralKey.genKey(party_ephemeral)
  227.         self.__g_po = self.__ephemeralKey.getSecret()
  228.         self.__ephemeralKey.genKey(party_signature)
  229.         self.__g_pO = self.__ephemeralKey.getSecret()
  230.  
  231.         self.genKey(party_ephemeral)
  232.         self.__g_Po = self.getSecret()
  233.  
  234.         self.__make_secret()
  235.  
  236.     def getSecret(self):
  237.         """
  238.       Return the preHashed key
  239.       """
  240.         return self.sharedSecret
  241.  
  242.     def __make_secret(self):
  243.         if self.__initiator:
  244.             self.__secret = self.__hash(self.__g_po, self.__g_pO, self.__g_Po)
  245.         else:
  246.             self.__secret = self.__hash(self.__g_po,self.__g_Po, self.__g_pO)
  247.  
  248.     def get_secret(self):
  249.         return self.__secret
  250.  
  251. if __name__=="__main__":
  252.     """
  253.   Run an example Diffie-Hellman exchange
  254.   """
  255.     a = DiffieHellman()
  256.     b = DiffieHellman()
  257.     a_challenge = a.establishBase()
  258.     b_challenge = b.establishBase()
  259.     a.establishBase(b_challenge)
  260.     b.establishBase(a_challenge)
  261.     print("Established Modulo", a.diffie_base)
  262.  
  263.     b.establishEphemeralListener()
  264.     a.genPublicKey()
  265.     b.genPublicKey()
  266.  
  267.     a.genKey(b.publicKey)
  268.     b.genKey(a.publicKey)
  269.  
  270. #    a.showParams()
  271. #    a.showResults()
  272. #    b.showParams()
  273. #    b.showResults()
  274.  
  275.     if(a.getKey() == b.getKey()):
  276.         print("Shared keys match.")
  277.         print("Key:", hexlify(a.key))
  278.         a_absoluteZero = int(a.getKey().encode('hex'), 16)
  279.         b_absoluteZero = int(b.getKey().encode('hex'), 16)
  280.     else:
  281.         print("Shared secrets didn't match!")
  282.         print("Shared secret A: ", a.genSecret(b.publicKey))
  283.         print("Shared secret B: ", b.genSecret(a.publicKey))
  284.  
  285.     a.establishAccord(b.getEphemeralPublicKey(), b.publicKey)
  286.     b.establishAccord(a.getEphemeralPublicKey(), a.publicKey)
  287.     if(a.get_secret() == b.get_secret()):
  288.         print("Shared secrets match.")
  289.         print("Key:", hexlify(a.get_secret()))
  290.         a_oxygen = int(a.get_secret().encode('hex'), 16)
  291.         b_oxygen = int(b.get_secret().encode('hex'), 16)
  292.     else:
  293.         print("Shared secrets didn't match!")
  294.         print("Shared secret A: ", a.get_secret())
  295.         print("Shared secret B: ", b.get_secret())
  296.  
  297.     a.establishAccord(b.getEphemeralPublicKey(), b.publicKey)
  298.     b.establishAccord(a.getEphemeralPublicKey(), a.publicKey)
  299.     if(a.get_secret() == b.get_secret()):
  300.         print("Shared secrets match.")
  301.         print("Key:", hexlify(a.get_secret()))
  302.         a_oxygen = int(a.get_secret().encode('hex'), 16)
  303.         b_oxygen = int(b.get_secret().encode('hex'), 16)
  304.     else:
  305.         print("Shared secrets didn't match!")
  306.         print("Shared secret A: ", a.get_secret())
  307.         print("Shared secret B: ", b.get_secret())
  308.  
  309.     a_carbon = pow(a.diffie_base, a.privateKey, a_oxygen)
  310.     b_carbon = pow(b.diffie_base, b.privateKey, b_oxygen) # carbon-like
  311. #    b_carbon = a_carbon # If they share one world
  312.     a_lithium = pow(b_carbon, a.privateKey, a_oxygen) # it oxidizes
  313.     b_lithium = pow(a_carbon, b.privateKey, b_oxygen)
  314. #    b_lithium = a_lithium # If they share one galaxy
  315.  
  316.     a_helium = int("Hello World".encode('hex'), 16)
  317.     a_sodium = pow(a_absoluteZero, a_lithium, a_oxygen)
  318.     a_potassium = pow(a_sodium, a_lithium, a_oxygen)
  319.     a_boron = pow(a_potassium, a_helium, a_sodium)
  320.     a_beryllium = pow(a_boron, a_lithium, a_sodium)
  321.  
  322.     b_sodium = pow(b_absoluteZero, b_lithium, b_oxygen)
  323.     b_potassium = pow(b_sodium, b_lithium, b_oxygen)
  324.     b_boron = pow(b_potassium, a_helium, b_sodium) # B is just a listener to the msg here exactly like Eve
  325.     b_beryllium = pow(b_boron, b_lithium, b_sodium)
  326.  
  327.     a_fluorine = pow(a_boron, a.privateKey, a.publicKey) # Prove To The Demon That The Signs Are Different
  328.     b_fluorine = pow(a_boron, b.privateKey, a.publicKey)
  329.     b_magnesium = pow(a_fluorine, b.privateKey, a.publicKey)
  330.     a_magnesium = pow(b_fluorine, a.privateKey, a.publicKey)
  331.  
  332.     if(a_magnesium == b_magnesium):
  333.         print("Shared signature verifier A matches.")
  334.         print("Key: {}".format(hex(a_magnesium)))
  335.     else:
  336.         print("Shared signature verifiers didn't match!")
  337.         print("Shared signature A: ", a_magnesium)
  338.         print("Shared signature B: ", b_magnesium)
  339.  
  340.     b_fluorine = pow(b_boron, b.privateKey, b.publicKey) # Prove To The Demon That The Signs Are Different
  341.     a_fluorine = pow(b_boron, a.privateKey, b.publicKey)
  342.     a_magnesium = pow(b_fluorine, a.privateKey, b.publicKey)
  343.     b_magnesium = pow(a_fluorine, b.privateKey, b.publicKey)
  344.  
  345.     a_magnesium2 = pow(a_magnesium, a.publicKey, b.publicKey)
  346.     a_magnesium3 = pow(a_magnesium, b.publicKey, a.publicKey)
  347.     b_magnesium2 = pow(b_magnesium, a.publicKey, b.publicKey)
  348.     b_magnesium3 = pow(b_magnesium, b.publicKey, a.publicKey)
  349.  
  350.     a_aluminum = pow(a_magnesium, a_magnesium2, a_magnesium3)
  351.     b_aluminum = pow(b_magnesium, b_magnesium2, b_magnesium3)
  352.  
  353.     if(a_aluminum == b_aluminum):
  354.         print("Aluminum Rectifier matches.")
  355.         print("Key: {}".format(hex(a_aluminum)))
  356.     else:
  357.         print("Aluminum Rectifier didn't match!")
  358.         print("Rectifier A: ", a_aluminum)
  359.         print("Rectifier B: ", b_aluminum)
  360.  
  361.     a_pseudo = pow(a_aluminum, a_potassium, a_boron)
  362.     b_pseudo = pow(b_aluminum, b_potassium, b_boron)
  363.     for i in range(2220): # Verify pseudo-random numbers
  364.         a_pseudo = pow(a_pseudo, a_potassium, a_boron)
  365.         b_pseudo = pow(b_pseudo, b_potassium, b_boron)
  366.         if(a_pseudo == b_pseudo):
  367.             print("Pseudorandom generator {} matches.".format(i))
  368.             print("Key: {}".format(hex(a_pseudo)))
  369.         else:
  370.             print("Pseudorandom generator {} didn't match!".format(i))
  371.             print("Pseudorandom A: ", a_pseudo)
  372.             print("Pseudorandom B: ", b_pseudo)
  373.  
  374.     if(a_magnesium == b_magnesium):
  375.         print("Shared signature verifier B matches.")
  376.         print("Key: {}".format(hex(b_magnesium)))
  377.     else:
  378.         print("Shared signature verifiers didn't match!")
  379.         print("Shared signature A: ", a_magnesium)
  380.         print("Shared signature B: ", b_magnesium)
  381.  
  382.     print("sodium: {}\n{}".format(a_sodium, b_sodium))
  383.     print("beryllium: {}\n{}".format(a_beryllium, b_beryllium))
  384.     print("lithium: {}\n{}".format(a_lithium, b_lithium))
  385.     print("potassium: {}\n{}".format(a_potassium, b_potassium))
  386.     print("boron: {}\n{}".format(a_boron, b_boron))
  387.  
  388.     a_sulfur = pow(a_potassium, a_oxygen, a_sodium)  # We Are At The 7th Numeric Integral Here
  389.     a_nitrogen = pow(a_sulfur, a_oxygen, a_sodium)
  390.     b_sulfur = pow(b_potassium, b_oxygen, b_sodium)  # We Are At The 7th Numeric Integral Here
  391.     b_nitrogen = pow(a_nitrogen, b_oxygen, b_sodium)
  392.     print("sulfur: {}\n{}".format(a_sulfur, b_sulfur))
  393.     print("nitrogen: {}\n{}".format(a_nitrogen, b_nitrogen))
  394.     print(pow(a_nitrogen, a_sulfur, b_nitrogen))
  395.     print(pow(b_nitrogen, a_sulfur, a_sodium))
  396.     exit()
  397.  
  398.     a_helium = int("Hello World 1".encode('hex'), 16)
  399.     a_silicon = pow(a_absoluteZero, a_nitrogen, a_oxygen)
  400.     a_phosphorous = pow(a_silicon, a_nitrogen, a_oxygen)
  401.     a_chlorine = pow(a_phosphorous, a_helium, a_silicon)
  402.     a_argon = pow(a_chlorine, a_nitrogen, a_silicon) # First Soft Metal
  403.  
  404.     b_hydrogen = pow(b_magnesium, 411, b_sodium)  # We Are At The 7th Numeric Integral Here
  405.     b_nitrogen = pow(b_hydrogen, 411, b_sodium)
  406.  
  407.     b_helium = int("Hello Other World 1".encode('hex'), 16)
  408.     b_silicon = pow(b_absoluteZero, b_nitrogen, b_oxygen)
  409.     b_phosphorous = pow(b_silicon, b_nitrogen, b_oxygen)
  410.     b_chlorine = pow(b_phosphorous, b_helium, b_silicon)
  411.     b_argon = pow(b_chlorine, b_nitrogen, b_silicon) # First Soft Metal
  412.  
  413. # Eighth Numeric Integral - A & B did not agree on a carbon so none of these should match
  414.     a_potassium = pow(a_absoluteZero, a_carbon, a_silicon)
  415.     a_calcium = pow(a_potassium, a_carbon, a_silicon)
  416.     a_scandium = pow(a_nitrogen, a_carbon, a_silicon)
  417.     a_titanium = pow(a_scandium, a_carbon, a_silicon)
  418.     a_vanadium = pow(a_argon, a_carbon, a_silicon)
  419.     a_chromium = pow(a_vanadium, a_carbon, a_silicon)
  420.     a_manganese = pow(a_magnesium, a_carbon, a_silicon)
  421.     a_iron = pow(a_manganese, a_carbon, a_silicon)
  422.  
  423.     b_potassium = pow(b_absoluteZero, b_carbon, b_silicon)
  424.     b_calcium = pow(b_potassium, b_carbon, b_silicon)
  425.     b_scandium = pow(b_nitrogen, b_carbon, b_silicon)
  426.     b_titanium = pow(b_scandium, b_carbon, b_silicon)
  427.     b_vanadium = pow(b_argon, b_carbon, b_silicon)
  428.     b_chromium = pow(b_vanadium, b_carbon, b_silicon)
  429.     b_manganese = pow(b_magnesium, b_carbon, b_silicon)
  430.     b_iron = pow(b_manganese, b_carbon, b_silicon)
  431.  
  432.     print("potassium: {}\n{}".format(a_potassium, b_potassium))
  433.     print("calcium: {}\n{}".format(a_calcium, b_calcium))
  434.     print("scandium: {}\n{}".format(a_scandium, b_scandium))
  435.     print("titanium: {}\n{}".format(a_titanium, b_titanium))
  436.     print("vanadium: {}\n{}".format(a_vanadium, b_vanadium))
  437.     print("chromium: {}\n{}".format(a_chromium, b_chromium))
  438.     print("manganese: {}\n{}".format(a_manganese, b_manganese))
  439.     print("iron: {}\n{}".format(a_iron, b_iron))
  440.  
  441.     a_cobalt = pow(a_absoluteZero, a_carbon, a_argon)
  442.     a_nickel = pow(a_cobalt, a_carbon, a_argon)
  443.     b_cobalt = pow(b_absoluteZero, b_carbon, b_argon)
  444.     b_nickel = pow(b_cobalt, b_carbon, b_argon)
  445.     print("cobalt: {}\n{}".format(a_cobalt, b_cobalt))
  446.     print("nickel: {}\n{}".format(a_nickel, b_nickel))
  447.  
  448.     a_copper = pow(a_manganese, a_calcium, a_scandium)
  449.     b_copper = pow(b_manganese, b_calcium, b_scandium)
  450.     a_zinc = pow(a_copper, a_calcium, a_scandium)
  451.     b_zinc = pow(b_copper, b_calcium, b_scandium)
  452.     print("copper: {}\n{}".format(a_copper, b_copper))
  453.     print("zinc: {}\n{}".format(a_zinc, b_zinc))
  454.  
  455.     a_gallium = pow(a_zinc, b_cobalt, a_nitrogen)
  456.     a_germanium = pow(a_gallium, b_cobalt, a_nitrogen)
  457.     b_gallium = pow(b_zinc, a_cobalt, b_nitrogen)
  458.     b_germanium = pow(b_gallium, a_cobalt, b_nitrogen)
  459.     print("gallium: {}\n{}".format(a_gallium, b_gallium))
  460.     print("germanium: {}\n{}".format(a_germanium, b_germanium))
  461.  
  462. # Experiments Below
  463.  
  464.     b_sulfur = pow(pow(b_phosphorous, b_nitrogen, b_silicon), b_nitrogen, b_silicon)
  465.     a_sulfur = pow(pow(a_phosphorous, a_nitrogen, a_silicon), a_nitrogen, a_silicon)
  466.  
  467.     if(a_sulfur == b_sulfur):
  468.         print("Sulfur Generation 1 Matches.")
  469.         print("Key: {}".format(hex(b_sulfur)))
  470.     else:
  471.         print("Sulfur verifiers didn't match!")
  472.         print("Dumb Wire A: ", a_sulfur)
  473.         print("Dumb Wire B: ", b_sulfur)
  474.  
  475.     print("silicon: {}\n{}".format(a_silicon, b_silicon))
  476.     print("argon: {}\n{}".format(a_argon, b_argon))
  477.     print("nitrogen: {}\n{}".format(a_nitrogen, b_nitrogen))
  478.     print("phosphorous: {}\n{}".format(a_phosphorous, b_phosphorous))
  479.     print("chlorine: {}\n{}".format(a_chlorine, b_chlorine))
  480.  
  481.     exit()
  482.  
  483.     b_sulfur2 = pow(b_phosphorous, b_sulfur, b_silicon)
  484.     a_sulfur2 = pow(a_phosphorous, a_sulfur, a_silicon)
  485.  
  486.     if(a_sulfur2 == b_sulfur2):
  487.         print("Sulfur Generation 2 Matches.")
  488.         print("Key: {}".format(hex(b_sulfur2)))
  489.     else:
  490.         print("Sulfur verifiers didn't match!")
  491.         print("Dumb Wire A: ", a_sulfur2)
  492.         print("Dumb Wire B: ", b_sulfur2)
  493.  
  494.     b_sulfur3 = pow(b_phosphorous, b_sulfur2, b_silicon)
  495.     a_sulfur3 = pow(a_phosphorous, a_sulfur2, a_silicon)
  496.  
  497.     if(a_sulfur3 == b_sulfur3):
  498.         print("Sulfur Generation 3 Matches.")
  499.         print("Key: {}".format(hex(b_sulfur3)))
  500.     else:
  501.         print("Damped Wire verifiers didn't match!")
  502.         print("Dumb Wire A: ", a_sulfur3)
  503.         print("Dumb Wire B: ", b_sulfur3)
  504.  
  505.     a_dN = pow(a_silicon, a_oxygen, a_sulfur3)
  506.     a_dD = pow(a_silicon, a_oxygen, a_sulfur2)
  507.     b_dN = pow(b_silicon, b_oxygen, b_sulfur3)
  508.     b_dD = pow(b_silicon, b_oxygen, b_sulfur2)
  509.  
  510.     print(a_dN)
  511.     print(a_dD)
  512.     print(b_dN)
  513.     print(b_dD)
  514.    
  515.     a_gN = pow(a_dN, a_oxygen, a_sulfur3)
  516.     a_gD = pow(a_dD, a_oxygen, a_sulfur2)
  517.     b_gN = pow(b_dN, b_oxygen, b_sulfur3)
  518.     b_gD = pow(b_dD, b_oxygen, b_sulfur2)
  519.  
  520.     print(a_gN)
  521.     print(a_gD)
  522.     print(b_gN)
  523.     print(b_gD)
  524.  
  525.     a_rN = pow(a_gN, a_hydrogen, a_nitrogen)  
  526.     a_rD = pow(a_gD, a_hydrogen, a_nitrogen)  
  527.     b_rN = pow(b_gN, b_hydrogen, b_nitrogen)  
  528.     b_rD = pow(b_gD, b_hydrogen, b_nitrogen)
  529.  
  530.     print(pow(a_rN, a_hydrogen, a_nitrogen))  
  531.     print(pow(a_rD, a_hydrogen, a_nitrogen))  
  532.     print(pow(b_rN, b_hydrogen, b_nitrogen))  
  533.     print(pow(b_rD, b_hydrogen, b_nitrogen))  
  534.  
  535.     a_germanium = pow(a_silicon, a_hydrogen, a_sulfur)
  536.     b_germanium = pow(b_silicon, b_hydrogen, b_sulfur)
  537.     a_tin = pow(a_germanium, a_hydrogen, a_sulfur)
  538.     b_tin = pow(b_germanium, b_hydrogen, b_sulfur)
  539.     a_lead = pow(a_tin, a_hydrogen, a_sulfur)
  540.     a_puter = pow(a_lead, a_tin, a_sulfur)
  541.     b_lead = pow(b_tin, b_hydrogen, b_sulfur)
  542.     b_puter = pow(b_lead, b_tin, b_sulfur)
  543.    
  544.     print(a_puter)
  545.     print(b_puter)
  546.     print(pow(a_puter, a_tin, a_lead))
  547.     print(pow(b_puter, b_tin, b_lead))
  548.     print(pow(a_germanium, a_tin, a_lead))
  549.     print(pow(b_germanium, b_tin, b_lead)) # Equality Proves That A & B Share A Moon
  550.  
  551.     print(pow(pow(a_carbon, a_magnesium, a_nitrogen), a_magnesium, a_nitrogen))
  552.     print(pow(pow(b_carbon, a_magnesium, b_nitrogen), a_magnesium, a_nitrogen))
Add Comment
Please, Sign In to add comment