Add checking password in AES encryption. Fix tests.