Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The DefaultPasswordService implementation automatically adds a random salt to each encryptPassword call. That "public" salt will be stored within the "hashedPasswordBase64" that you receive from "encryptPassword".</p> <p>Because the "public" salt is individually generated for each hashed password one cannot "simply" generate a rainbow table and brute-force all your hashed passwords at once. For each hashed password the attacker would have to generate an own, unique rainbow table because of the unique "public" salt. So far you do not need to put an extra salt into the database.</p> <p>To make your stored hashed passwords even more secure you can furthermore add a "private" salt that should be stored anywhere else - as long as not in the database. By using a "private" salt you could protect the hashed passwords against a brute-force rainbow-table attack, because the attacker does not know the "private" salt and cannot gain the "private" salt from the database entries.</p> <p>This is a very basic example how to create a PasswordService that utilizes a "private" salt provided as a constant string and that works as CredentialsMatcher:</p> <pre><code>public class MyPrivateSaltingPasswortService extends DefaultPasswordService { public MyPrivateSaltingPasswortService() { super(); HashService service = getHashService(); if (service instanceof DefaultHashService) { ((DefaultHashService) service).setPrivateSalt( new SimpleByteSource("MySuperSecretPrivateSalt")); } } } </code></pre> <p>you then could use your own implementation in shiro.ini:</p> <pre><code>[main] saltedService = com.mycompany.MyPrivateSaltingPasswortService matcher = org.apache.shiro.authc.credential.PasswordMatcher matcher.passwordService = $saltedService realm.credentialsMatcher = $matcher </code></pre> <p>This example was created using shiro-1.2.2</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload