mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Increase Remote app PBKDF2 iterations to 600,000 and SHA256 hash
OWASP Cheat Sheet recommends 600,000 iterations for SHA256. https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2
This commit is contained in:
parent
4582ff4a56
commit
282810e9ca
1 changed files with 5 additions and 5 deletions
|
@ -44,14 +44,14 @@ try:
|
||||||
from Cryptodome.Protocol.KDF import PBKDF2
|
from Cryptodome.Protocol.KDF import PBKDF2
|
||||||
from Cryptodome.Cipher import AES
|
from Cryptodome.Cipher import AES
|
||||||
from Cryptodome.Random import get_random_bytes
|
from Cryptodome.Random import get_random_bytes
|
||||||
from Cryptodome.Hash import HMAC, SHA1
|
from Cryptodome.Hash import SHA256
|
||||||
CRYPTODOME = True
|
CRYPTODOME = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from Crypto.Protocol.KDF import PBKDF2
|
from Crypto.Protocol.KDF import PBKDF2
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
from Crypto.Random import get_random_bytes
|
from Crypto.Random import get_random_bytes
|
||||||
from Crypto.Hash import HMAC, SHA1
|
from Crypto.Hash import SHA256
|
||||||
CRYPTODOME = True
|
CRYPTODOME = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
CRYPTODOME = False
|
CRYPTODOME = False
|
||||||
|
@ -3825,9 +3825,8 @@ class TAUTULLIREMOTEAPP(Notifier):
|
||||||
salt = get_random_bytes(16)
|
salt = get_random_bytes(16)
|
||||||
passphrase = device['device_token']
|
passphrase = device['device_token']
|
||||||
key_length = 32 # AES256
|
key_length = 32 # AES256
|
||||||
iterations = 1000
|
iterations = 600000
|
||||||
key = PBKDF2(passphrase, salt, dkLen=key_length, count=iterations,
|
key = PBKDF2(passphrase, salt, dkLen=key_length, count=iterations, hmac_hash_module=SHA256)
|
||||||
prf=lambda p, s: HMAC.new(p, s, SHA1).digest())
|
|
||||||
|
|
||||||
#logger.debug("Encryption key (base64): {}".format(base64.b64encode(key)))
|
#logger.debug("Encryption key (base64): {}".format(base64.b64encode(key)))
|
||||||
|
|
||||||
|
@ -3846,6 +3845,7 @@ class TAUTULLIREMOTEAPP(Notifier):
|
||||||
'include_player_ids': [device['onesignal_id']],
|
'include_player_ids': [device['onesignal_id']],
|
||||||
'contents': {'en': 'Tautulli Notification'},
|
'contents': {'en': 'Tautulli Notification'},
|
||||||
'data': {'encrypted': True,
|
'data': {'encrypted': True,
|
||||||
|
'version': 2,
|
||||||
'cipher_text': base64.b64encode(encrypted_data),
|
'cipher_text': base64.b64encode(encrypted_data),
|
||||||
'nonce': base64.b64encode(nonce),
|
'nonce': base64.b64encode(nonce),
|
||||||
'salt': base64.b64encode(salt),
|
'salt': base64.b64encode(salt),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue