Package org.jasypt.digest

Examples of org.jasypt.digest.StandardStringDigester


     * Creates a new instance of <tt>StrongPasswordEncryptor</tt>
     *
     */
    public StrongPasswordEncryptor() {
        super();
        this.digester = new StandardStringDigester();
        this.digester.setAlgorithm("SHA-256");
        this.digester.setIterations(100000);
        this.digester.setSaltSizeBytes(16);
        this.digester.initialize();
    }
View Full Code Here


     * Creates a new instance of <tt>BasicPasswordEncryptor</tt>
     *
     */
    public BasicPasswordEncryptor() {
        super();
        this.digester = new StandardStringDigester();
        this.digester.initialize();
    }
View Full Code Here

     * Creates a new instance of <tt>ConfigurablePasswordEncryptor</tt>
     *
     */
    public ConfigurablePasswordEncryptor() {
        super();
        this.digester = new StandardStringDigester();
    }
View Full Code Here

     * Creates a new instance of <tt>RFC2307OpenLDAPSSHAPasswordEncryptor</tt>
     *
     */
    public RFC2307SMD5PasswordEncryptor() {
        super();
        this.digester = new StandardStringDigester();
        this.digester.setAlgorithm("MD5");
        this.digester.setIterations(1);
        this.digester.setSaltSizeBytes(8);
        this.digester.setPrefix("{SMD5}");
        this.digester.setInvertPositionOfSaltInMessageBeforeDigesting(true);
View Full Code Here

     * Creates a new instance of <tt>RFC2307MD5PasswordEncryptor</tt>
     *
     */
    public RFC2307MD5PasswordEncryptor() {
        super();
        this.digester = new StandardStringDigester();
        this.digester.setAlgorithm("MD5");
        this.digester.setIterations(1);
        this.digester.setSaltSizeBytes(0);
        this.digester.setPrefix("{MD5}");
    }
View Full Code Here

     * Creates a new instance of <tt>RFC2307OpenLDAPSSHAPasswordEncryptor</tt>
     *
     */
    public RFC2307SSHAPasswordEncryptor() {
        super();
        this.digester = new StandardStringDigester();
        this.digester.setAlgorithm("SHA-1");
        this.digester.setIterations(1);
        this.digester.setSaltSizeBytes(8);
        this.digester.setPrefix("{SSHA}");
        this.digester.setInvertPositionOfSaltInMessageBeforeDigesting(true);
View Full Code Here

     * Creates a new instance of <tt>RFC2307SHAPasswordEncryptor</tt>
     *
     */
    public RFC2307SHAPasswordEncryptor() {
        super();
        this.digester = new StandardStringDigester();
        this.digester.setAlgorithm("SHA-1");
        this.digester.setIterations(1);
        this.digester.setSaltSizeBytes(0);
        this.digester.setPrefix("{SHA}");
    }
View Full Code Here

        if (suffix != null) {
            config.setSuffix(suffix);
        }
       
       
        final StandardStringDigester digester = new StandardStringDigester();
        digester.setConfig(config);
       
        return digester.digest(input);
       
    }
View Full Code Here

        return value;
    }

    private StandardStringDigester getDigester(final CipherAlgorithm cipherAlgorithm) {
        StandardStringDigester digester = new StandardStringDigester();

        if (cipherAlgorithm.getAlgorithm().startsWith("S-")) {
            // Salted ...
            digester.setAlgorithm(cipherAlgorithm.getAlgorithm().replaceFirst("S\\-", ""));
            digester.setIterations(saltIterations);
            digester.setSaltSizeBytes(saltSizeBytes);
            digester.setInvertPositionOfPlainSaltInEncryptionResults(ipopsier);
            digester.setInvertPositionOfSaltInMessageBeforeDigesting(iposimbd);
            digester.setUseLenientSaltSizeCheck(ulssc);
        } else {
            // Not salted ...
            digester.setAlgorithm(cipherAlgorithm.getAlgorithm());
            digester.setIterations(1);
            digester.setSaltSizeBytes(0);
        }

        digester.setStringOutputType(CommonUtils.STRING_OUTPUT_TYPE_HEXADECIMAL);
        return digester;
    }
View Full Code Here

TOP

Related Classes of org.jasypt.digest.StandardStringDigester

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.