Last active
May 26, 2020 07:26
-
-
Save anon5r/fabdfdcc98a2d9305ec2d34024d0707d to your computer and use it in GitHub Desktop.
Scripts to export hashed IP/mobile phone numbers in Japan as CSV text files
This file contains 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 python | |
import hashlib | |
prefix = ['050','070','080','090']; | |
x = 1000; # mobile/IP phone number will be starts with 1, not 0 | |
column = ['NUMBER','MD5','SHA1','SHA256','SHA384','SHA512']; | |
print(format('"%s"' % ('", "'.join(column)))) | |
for p in prefix: | |
while x <= 9999: | |
y = 0; | |
while y <= 9999: | |
number = format('%s%04d%04d' % (p,x,y)) | |
output_list = [ | |
number, # numbers | |
hashlib.md5(number).hexdigest(), # number by md5 | |
hashlib.sha1(number).hexdigest(), # number by sha1 | |
hashlib.sha256(number).hexdigest(), # number by sha256 | |
hashlib.sha384(number).hexdigest(), # number by sha384 | |
hashlib.sha512(number).hexdigest() # number by sha512 | |
] | |
print(format('"%s"' % ('","'.join(output_list)))) | |
y = y+1 | |
x = x+1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment