-
-
Save zeptovn/710911f6ef373c330a8afa993c6b2d0c to your computer and use it in GitHub Desktop.
vskey
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/python2 | |
import binascii | |
import hashlib | |
drv='/dev/sdb' | |
mode='rb+' | |
sector_size=512 | |
magic_string=r"%@#$*&^!**$#&@^%%@#$*&^!**$#&@^%" | |
magic_number=55 | |
pwd='adminn' | |
pwd=raw_input('pwd: ') | |
drv=raw_input('drv: ') | |
with open(drv, mode) as disk: | |
# option 1: change the password | |
encrypt_pwd_sector = 5*sector_size+len(magic_string) | |
encrypted_pwd = hashlib.sha512("Ivan Medvedev"+pwd).digest() | |
disk.seek(encrypt_pwd_sector) | |
disk.write(encrypted_pwd+(32-len(encrypted_pwd))*b'\x00') | |
print 'your password is:' + pwd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment