Password hashing method: FixMe, ToDo, Note

New Issue
Summary: Password hashing is too weak
Status: New
Owner: eric.maeker@gmail.com
Cc: contact@medecinelibre.com
Labels: +Type-Enhancement +Priority-Critical +Milestone-Release0.9.0 +Component-FreeMedForms +Security +Maintainability
>>> >> SHA-1 (used by FMF in /libs/utils/global.cpp to hash password) is a
>>> >> message digest, not a secure password hashing algorithm.
>>> >> see: http://www.infosecurity-magazine.com/view/14059/sha1-crypto-protocol-cracked-using-amazon-cloud-computing-resources/

The main problem was that Qt4.x does only include Md4, Md5 and SHA1 hashing methods. Qt5 introduces many more (SHA256).

Qt4.8 (default Qt version in wheezy & still in sid)

	http://qt-project.org/doc/qt-4.8/qcryptographichash.html

Qt5.3 (available in wheezy and sid)

	http://qt-project.org/doc/qt-5/qcryptographichash.html

The password hash are stored in the FMF user database.
We can store password in a prefixed string like this:

	<sha1-hash>			// for old compatibility
	<method>:<method-hash>  	// updated password hash

Eg:
	sha256:<sha256-hash>  	// updated sha256
	sha512:<sha512-hash>  	// updated sha512

This will prohibit the retrocompatibility with a previous version in case of problems. As version <= 0.9.0 will not be able to check the passwords of users using more than SHA1 hashing method.
Merge branch 'master' of https://code.google.com/p/freemedforms