264 """ |
264 """ |
265 Module function to encrypt a password. |
265 Module function to encrypt a password. |
266 |
266 |
267 @param data data to encrypt (bytes) |
267 @param data data to encrypt (bytes) |
268 @param password password to be used for encryption (string) |
268 @param password password to be used for encryption (string) |
269 @keyparam keyLength length of the key to be generated for encryption |
269 @param keyLength length of the key to be generated for encryption |
270 (16, 24 or 32) |
270 (16, 24 or 32) |
271 @keyparam hashIterations number of hashes to be applied to the password for |
271 @param hashIterations number of hashes to be applied to the password for |
272 generating the encryption key (integer) |
272 generating the encryption key (integer) |
273 @return encrypted data (bytes) and flag indicating |
273 @return encrypted data (bytes) and flag indicating |
274 success (boolean) |
274 success (boolean) |
275 """ |
275 """ |
276 from .py3AES import encryptData |
276 from .py3AES import encryptData |
295 """ |
295 """ |
296 Module function to decrypt a password. |
296 Module function to decrypt a password. |
297 |
297 |
298 @param edata hashed data to decrypt (string) |
298 @param edata hashed data to decrypt (string) |
299 @param password password to be used for decryption (string) |
299 @param password password to be used for decryption (string) |
300 @keyparam keyLength length of the key to be generated for decryption |
300 @param keyLength length of the key to be generated for decryption |
301 (16, 24 or 32) |
301 (16, 24 or 32) |
302 @return decrypted data (bytes) and flag indicating |
302 @return decrypted data (bytes) and flag indicating |
303 success (boolean) |
303 success (boolean) |
304 """ |
304 """ |
305 if not edata.startswith(CryptoMarker.encode("utf-8")): |
305 if not edata.startswith(CryptoMarker.encode("utf-8")): |