Examples of digest()


Examples of org.jasypt.digest.StandardByteDigester.digest()

    byteDigester.setAlgorithm("SHA-512");
    byteDigester.setSaltSizeBytes(128);
    // Load binary data from a image file
    byte[] data = IOUtils.toByteArray(this.getClass().getResourceAsStream("/jasypt.png"));
    // Generate a digest
    byte[] digest = byteDigester.digest(data);
    // Display it
    String str = String.valueOf(Hex.encodeHex(digest));
    System.out.printf("testDigesters : Byte digest '%s'\n", str);
    /* STRING Digester */
    // Create a String digester
View Full Code Here

Examples of org.jasypt.digest.StandardStringDigester.digest()

public class SignupUtils {
  public static String generateEmailConfirmHash(User user)
  {
    //FIXME: This should really use its own salt, but this is sufficient for now, since the encrypted password uses a salt
    StandardStringDigester digestor = new StandardStringDigester();
    return digestor.digest(user.getName() + user.getPasswordEncrypted())
  }
 
  public static boolean checkEmailHash(User user, String hash)
  {
    StandardStringDigester digestor = new StandardStringDigester();
View Full Code Here

Examples of org.jasypt.intf.service.JasyptStatelessService.digest()

            String input = argumentValues.getProperty(ArgumentNaming.ARG_INPUT);

            CLIUtils.showArgumentDescription(argumentValues, verbose);
           
            String result =
                service.digest(
                        input,
                        argumentValues.getProperty(ArgumentNaming.ARG_ALGORITHM),
                        null,
                        null,
                        argumentValues.getProperty(ArgumentNaming.ARG_ITERATIONS),
View Full Code Here

Examples of org.jasypt.util.digest.Digester.digest()

   * @param s String
   * @Return MD5 checksum of the specified String as a Hex String
   */
  public static String getMd5Checksum(String s) {
    Digester digester = new Digester();
    return JuStringUtils.toHexString(digester.digest(s.getBytes()));
  }
 
  public static String toHexString(byte[] b) {
    StringBuffer sb = new StringBuffer();
        for (int j = 0; j < b.length; ++j) {
View Full Code Here

Examples of org.jboss.errai.otec.client.util.Md5Digest.digest()

  private static String createHashFor(final String string) {
    try {
      final Md5Digest digest = new Md5Digest();
      digest.update(string.getBytes("UTF-8"));
      return hashToHexString(digest.digest());
    }
    catch (Throwable e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of org.springframework.security.crypto.password.Digester.digest()

public class DigesterTests {

    @Test
    public void digestIsCorrectFor3Iterations() {
        Digester digester = new Digester("SHA-1", 3);
        byte[] result = digester.digest(Utf8.encode("text"));
        // echo -n text | openssl sha1 -binary | openssl sha1 -binary | openssl sha1
        assertEquals("3cfa28da425eca5b894f0af2b158adf7001e000f", new String(Hex.encode(result)));
    }

}
View Full Code Here

Examples of org.vngx.jsch.hash.Hash.digest()

      buffer.putBytes(H);
      int letterIndex = buffer.index;
      buffer.putByte((byte) 0x41)// 0x41 = 'A'
      buffer.putBytes(_session.getSessionId());
      hash.update(buffer.buffer, 0, buffer.index);
      byte[] c2sCipherIV = hash.digest();

      buffer.buffer[letterIndex]++;  // Increment to 'B'
      hash.update(buffer.buffer, 0, buffer.index);
      byte[] s2cCipherIV = hash.digest();
View Full Code Here

Examples of penny.recmd5.MD5MessageDigest.digest()

        expected.update(message.getBytes());
        String s = new BigInteger(1, expected.digest()).toString(16);
        if (s.length() == 31) {
            s = "0" + s;
        }
        test.digest(message.getBytes());
        System.out.println(s);
        System.out.println(test.getState().toString());
    }
}
View Full Code Here

Examples of resources.digesters.Factory.digest()

                      rootDir + File.separator + "simulation-rules.xml");
      if ( factory == null )
        throw new SimulationException"No pudo crearse la factor�a para " +
                        "levantar la simulaci�n." );
 
      simulation = (Simulation)factory.digest();     
     
      if (simulation == null)
        throw new SimulationException( "No pudo cargarse la simulaci�n." );
    }
    catch (IOException e)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.