mirror of
https://github.com/RealityNet/kobackupdec.git
synced 2025-04-06 04:00:08 +08:00
fast workaround for new style of backup
This commit is contained in:
parent
1030d7d24c
commit
6dd191e504
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
#ignore all
|
||||
*
|
||||
#track dirs
|
||||
!*/
|
||||
#track #-DLH-# dir
|
||||
!/#-DLH-#/
|
||||
#track python files
|
||||
!*.py
|
||||
#track readme
|
||||
!readme.md
|
||||
#track .gitignore
|
||||
!.gitignore
|
@ -266,21 +266,32 @@ class Decryptor:
|
||||
logging.debug('SHA256(BKEY)[%s] = %s', len(self._bkey_sha256),
|
||||
binascii.hexlify(self._bkey_sha256))
|
||||
|
||||
salt = self._checkMsg[32:]
|
||||
logging.debug('SALT[%s] = %s', len(salt), binascii.hexlify(salt))
|
||||
try:
|
||||
salt = self._checkMsg[32:]
|
||||
logging.debug('SALT[%s] = %s', len(salt), binascii.hexlify(salt))
|
||||
|
||||
res = PBKDF2(self._bkey, salt, Decryptor.dklen, Decryptor.count,
|
||||
Decryptor.prf, hmac_hash_module=None)
|
||||
logging.debug('KEY check expected = %s',
|
||||
binascii.hexlify(self._checkMsg[:32]))
|
||||
logging.debug('RESULT = %s', binascii.hexlify(res))
|
||||
res = PBKDF2(self._bkey, salt, Decryptor.dklen, Decryptor.count,
|
||||
Decryptor.prf, hmac_hash_module=None)
|
||||
logging.debug('KEY check expected = %s',
|
||||
binascii.hexlify(self._checkMsg[:32]))
|
||||
logging.debug('RESULT = %s', binascii.hexlify(res))
|
||||
|
||||
if res == self._checkMsg[:32]:
|
||||
logging.info('OK, backup key is correct!')
|
||||
if res == self._checkMsg[:32]:
|
||||
logging.info('OK, backup key is correct!')
|
||||
self._good = True
|
||||
else:
|
||||
logging.error('KO, backup key is wrong!')
|
||||
self._good = False
|
||||
|
||||
except:
|
||||
print()
|
||||
logging.error('NEW TYPE of backup found!')
|
||||
logging.error('no check for correct key! will try to decrypt anyway...')
|
||||
logging.error('be SURE that pass is correct!')
|
||||
print()
|
||||
input('press ENTER to continue...or cancel script with CTRL + C')
|
||||
self._good = True
|
||||
else:
|
||||
logging.error('KO, backup key is wrong!')
|
||||
self._good = False
|
||||
pass
|
||||
|
||||
def decrypt_package(self, dec_material, data):
|
||||
if not self._good:
|
||||
|
Loading…
x
Reference in New Issue
Block a user