# BASIC UNDERSTANDING
# user decoding
import base64
passwd = base64.b64encode("password") print(passwd) cGFzc3dvcmQ= passwd_decode = base64.b64decode("cGFzc3dvcmQ=") print(passwd_decode) password
#Indepth coding & Decoding password and username
#**************************************************************************
########################################
# passwd encoding & decoding # password gnerator # fwere import base64 PASSWDFILE = r"C:\Python27\da-testing-login-python\official-selenium-login\bdcgpasswd.txt" with open(PASSWDFILE, 'r') as psfile: for line in psfile: passwd = base64.b64encode(line) encryptedpwd = passwd if encryptedpwd: print(encryptedpwd) newpath = r"C:\Python27\da-testing-login-python\official-selenium-login\bdgcpss.txt" new_file = open(newpath, "wb") new_file.write(encryptedpwd) new_file.close() print(line) newpasswd = base64.b64decode(encryptedpwd) print(newpasswd)
# Using encrypted passwd
# using encrypted passord BDGCPASS = r"C:\Python27\da-testing-login-python\official-selenium-login\bdgcpss.txt" with open(BDGCPASS, 'r') as psfile: for line in psfile: newpasswd = base64.b64decode(line) BDGCQAPASSWORD = newpasswd
#DECODING ENCRYPTION
#*****************************************************************************
# USER ENCODING BDGCQA # USER GENERATOR # fwere
import base64 BDGCQAUSER = r"C:\Python27\da-testing-login-python\official-selenium-login\bdcgqauser.txt" with open(BDGCQAUSER, 'r') as psfile: for line in psfile: user = base64.b64encode(line) encrypteduser = user if encrypteduser: print(encrypteduser) newpath = r"C:\Python27\da-testing-login-python\official-selenium-login\bdgcqauser.txt" new_file = open(newpath, "wb") new_file.write(encrypteduser) new_file.close() print(line) newuser = base64.b64decode(encrypteduser) print(newuser)
#_User Decoding
#**********************************************************************
# user decoding # using encrypted user
import base64 BDGCQAUSER = r"C:\Python27\da-testing-login-python\official-selenium-login\bdgcqauser.txt" with open(BDGCQAUSER, 'r') as psfile: for line in psfile: newuser = base64.b64decode(line) BDGCQAUSERLOGIN = newuser