Added support for legacy password encryption