Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zeptovn
Created December 8, 2017 07:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeptovn/710911f6ef373c330a8afa993c6b2d0c to your computer and use it in GitHub Desktop.
Save zeptovn/710911f6ef373c330a8afa993c6b2d0c to your computer and use it in GitHub Desktop.
vskey
#!/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