PySide6.QtNetwork.QPasswordDigestor¶
- class QPasswordDigestor¶
- The QPasswordDigestor namespace contains functions which you can use to generate hashes or keys. More… - Synopsis¶- Static functions¶- Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- static deriveKeyPbkdf1(algorithm, password, salt, iterations, dkLen)¶
- Parameters:
- algorithm – - Algorithm
- password – - QByteArray
- salt – - QByteArray
- iterations – int 
- dkLen – int 
 
- Return type:
 
 - Returns a hash computed using the PBKDF1-algorithm as defined in RFC 8018, section 5.1. - The function takes the - dataand- salt, and then hashes it repeatedly for- iterationsiterations using the specified hash- algorithm. If the resulting hash is longer than- dkLenthen it is truncated before it is returned.- This function only supports SHA-1 and MD5! The max output size is 160 bits (20 bytes) when using SHA-1, or 128 bits (16 bytes) when using MD5. Specifying a value for - dkLenwhich is greater than this results in a warning and an empty QByteArray is returned. To programmatically check this limit you can use QCryptographicHash::hashLength. Furthermore: the- saltmust always be 8 bytes long!- Note - This function is provided for use with legacy applications and all new applications are recommended to use - PBKDF2.- See also - deriveKeyPbkdf2- hashLength- static deriveKeyPbkdf2(algorithm, password, salt, iterations, dkLen)¶
- Parameters:
- algorithm – - Algorithm
- password – - QByteArray
- salt – - QByteArray
- iterations – int 
- dkLen – int 
 
- Return type:
 
 - Derive a key using the PBKDF2-algorithm as defined in RFC 8018, section 5.2. - This function takes the - dataand- salt, and then applies HMAC-X, where the X is- algorithm, repeatedly. It internally concatenates intermediate results to the final output until at least- dkLenamount of bytes have been computed and it will execute HMAC-X- iterationstimes each time a concatenation is required. The total number of times it will execute HMAC-X depends on- iterations,- dkLenand- algorithmand can be calculated as- iterations * ceil(dkLen / QCryptographicHash::hashLength(algorithm)).- See also - deriveKeyPbkdf1- QMessageAuthenticationCodeQCryptographicHash