Advertisement
imk0tter

NUMBER ENCRYPTION (BICRYPTION)

Jan 23rd, 2025
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.66 KB | None | 0 0
  1. def ENCRYPT_NUMBER(BASE, INPUT):
  2.     return ((BASE[0] * 2) + 1) * (2 ** (0 if INPUT < 0 else INPUT)), ((BASE[1] * 2) + 1) * (2 ** ((INPUT * -1) if INPUT < 0 else 0))
  3.  
  4. # TODO: DECRYPT WITHOUT ITERATION OR RECURSION
  5. def DECRYPT_BASE(BASE):
  6.     BASE_BIT = 0
  7.     while BASE % 2 == 0:
  8.         BASE = BASE / 2
  9.         BASE_BIT = BASE_BIT + 1
  10.     BASE = (BASE - 1) / 2
  11.     return BASE, BASE_BIT
  12.  
  13. def DECRYPT_NUMBER(BASE):
  14.     POSITIVE_BASE = BASE[0]
  15.     NEGATIVE_BASE = BASE[1]
  16.  
  17.     POSITIVE_BASE,POSITIVE_BIT = DECRYPT_BASE(POSITIVE_BASE)
  18.     NEGATIVE_BASE,NEGATIVE_BIT = DECRYPT_BASE(NEGATIVE_BASE)
  19.  
  20.     return tuple([POSITIVE_BASE,NEGATIVE_BASE]), POSITIVE_BIT - NEGATIVE_BIT
  21.  
  22. def REVERSE_ENCRYPTION(BASE):
  23.     POSITIVE_BASE = BASE[0]
  24.     NEGATIVE_BASE = BASE[1]
  25.  
  26.     ENCRYPTION = (0,0)
  27.     while POSITIVE_BASE > 0 or NEGATIVE_BASE > 0:
  28.         BASE, BIT = DECRYPT_NUMBER(BASE)
  29.         POSITIVE_BASE, NEGATIVE_BASE = BASE
  30.         ENCRYPTION = ENCRYPT_NUMBER(ENCRYPTION, BIT)
  31.  
  32.     return ENCRYPTION
  33.  
  34. BASE = (0, 0)
  35. BASE = ENCRYPT_NUMBER(BASE, 0)
  36. BASE = ENCRYPT_NUMBER(BASE, 1)
  37. BASE = ENCRYPT_NUMBER(BASE, 2)
  38. BASE = ENCRYPT_NUMBER(BASE, 3)
  39. BASE = ENCRYPT_NUMBER(BASE, 4)
  40. BASE = ENCRYPT_NUMBER(BASE, 5)
  41. BASE = ENCRYPT_NUMBER(BASE, -6)
  42. BASE = ENCRYPT_NUMBER(BASE, -7)
  43. BASE = ENCRYPT_NUMBER(BASE, -8)
  44. BASE = ENCRYPT_NUMBER(BASE, 9)
  45. BASE = ENCRYPT_NUMBER(BASE, -10)
  46.  
  47. BASE = REVERSE_ENCRYPTION(BASE)
  48.  
  49. POSITIVE,NEGATIVE = BASE
  50. while POSITIVE > 0 or NEGATIVE > 0:
  51.     BASE,DECRYPTED= DECRYPT_NUMBER(BASE)
  52.     POSITIVE,NEGATIVE = BASE
  53.     print("POSITIVE_ENCRYPTION: " + str(POSITIVE) + ", NEGATIVE_ENCRYPTION: " + str(NEGATIVE) + ", DECRYPTED: " + str(DECRYPTED))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement