Created
October 31, 2016 12:58
-
-
Save jettero/d5f4db653a055585012c3075e14132ff to your computer and use it in GitHub Desktop.
teamspeak password encoder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: UTF-8 | |
# I found that I could select the server admin password in the sqlite3 database | |
# and I could update/change it, but just what is that annoying encoding? It's mime... | |
# decodes to 20 bytes... | |
# | |
# Ahh, it's base64(sha1()) unsalted | |
import hashlib | |
import base64 | |
def encode_pass(x): | |
sha1 = hashlib.sha1() | |
sha1.update(x.encode()) | |
return base64.encodebytes(sha1.digest()).decode().strip() | |
if __name__ == "__main__": | |
import getpass | |
p = getpass.getpass("pass: ") | |
e = encode_pass(p) | |
print( e ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment