Skip to content

Instantly share code, notes, and snippets.

@incogbyte
Created February 15, 2022 14:05
Show Gist options
  • Save incogbyte/33b01d3197021539a1201ce0d86542b5 to your computer and use it in GitHub Desktop.
Save incogbyte/33b01d3197021539a1201ce0d86542b5 to your computer and use it in GitHub Desktop.
Small script to generate base64 passwords like, admin:admin
import os
import sys
import base64
'''
Small script to generate base64 passwords like, YWRtaW46YWRtaW4=
usage
python3 base64PassGen.py emails.txt passwords.txt
'''
users = open(sys.argv[1], 'r') # users or emails
passwords = open(sys.argv[2], 'r') # passwords
with open(sys.argv[1], 'r') as users:
for line in users:
usr = line.strip()
with open(sys.argv[2], 'r') as passwd:
for p in passwd:
pwd = p.strip()
credencial = f"{usr}:{pwd}"
strInBytes = credencial.encode('ascii')
base64Bytes = base64.b64encode(strInBytes)
base64Message = base64Bytes.decode('ascii')
print(base64Message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment