Backport \OC\Security\Crypto to ownCloud 7

Conflicts:
	lib/repair/repairconfig.php
Only store user credentials when SMB_OC storage is enabled
Merge pull request #11747 from owncloud/storeCredentialsOnlyInSessionIfRequired

Store credentials only in session if required