-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome the documentation of this Java example for encrypting and hashing passwords.
To get a better overview of the code structure the architecture depicted below was made. It shows all the used packages and the dependencies.
In the sections on this page you get an overview of the most important part of the software design.
Below you will find the class diagram of this example. As you can see it is a console application. A 3-tier architecture however is implemented so that you can use the logic in the BLL-package to easily integrate it in your own application.
You can request a specific encryptor implementation from the EncrypterFactory class through the static method getEncrypter(EncryptionAlgorithm) which returns the specified PasswordEncrypter.
In the following sequence diagram you can see how the encryption algorithm that is used is fetched and by which class. When the AccountRepository is instantiated, its constructor will get the algorithm that will be used for login and registering accounts.
The next sequence diagram shows the login procedure. From this diagram you can see that the AccountRepository first needs to fetch the salt for the user. With the salt, and the given username, the AccountRepository then checks with the AccountContext whether or not the credentials are correct.