Class Shiro2CryptFormat

java.lang.Object
org.apache.shiro.crypto.hash.format.Shiro2CryptFormat
All Implemented Interfaces:
HashFormat, ModularCryptFormat, ParsableHashFormat

The Shiro2CryptFormat is a fully reversible Modular Crypt Format (MCF). It is based on the posix format for storing KDF-hashed passwords in /etc/shadow files on linux and unix-alike systems.

Format

Hash instances formatted with this implementation will result in a String with the following dollar-sign ($) delimited format:

 $mcfFormatId$algorithmName$algorithm-specific-data.
 

Each token is defined as follows:

Position Token Description Required?
1 mcfFormatId The Modular Crypt Format identifier for this implementation, equal to shiro2. ( This implies that all shiro2 MCF-formatted strings will always begin with the prefix $shiro2$ ). true
2 algorithmName The name of the hash algorithm used to perform the hash. Either a hash class exists, or otherwise a UnsupportedOperationException will be thrown. true
3 algorithm-specific-data In contrast to the previous shiro1 format, the shiro2 format does not make any assumptions about how an algorithm stores its data. Therefore, everything beyond the first token is handled over to the Hash implementation.
Since:
2.0
See Also: