SeleniumBase/seleniumbase/common/unobfuscate.py

36 lines
967 B
Python
Raw Normal View History

"""
Unobfuscates an encrypted string/password into a plaintext string/password.
Usage:
python unobfuscate.py
Then enter the encrypted string/password.
The result is a plaintext string/password.
Works the same as obfuscate.py, but doesn't mask the input.
"""
from seleniumbase.common import encryption
2019-07-30 14:57:55 +08:00
import sys
import time
def main():
2019-07-30 14:57:55 +08:00
if sys.version_info[0] >= 3:
input_method = input # Using Python 3 (or higher)
else:
# Python 2 has the raw_input() method. Python 3 does not.
input_method = raw_input # noqa: ignore=F821
try:
while(1):
code = input_method(
'\nEnter obfuscated/encrypted string: (CTRL+C to exit):\n')
print("\nHere is the unobfuscated string/password:")
time.sleep(0.07)
print(encryption.decrypt(code))
time.sleep(0.21)
2018-02-09 07:00:25 +08:00
except KeyboardInterrupt:
print("\nExiting...\n")
if __name__ == "__main__":
main()