Examples of digest()


Examples of java.security.MessageDigest.digest()

    char[] passwordHash = toBase64(result);

    md5.reset();
    byte[] cryptResult = crypt(password, "$1$_2S43d5f$");
    md5.update(cryptResult);
    result = Util.byteArrayToCharArray(md5.digest());
    char[] cryptHash = toBase64(result);

    int sv = seed[15] % 8;
    char checksum = 0;
    String hashStringP = null, hashStringC = null;
View Full Code Here

Examples of java.security.MessageDigest.digest()

        break;
    }

    md5.reset();
    md5.update(hashStringP.getBytes());
    result = Util.byteArrayToCharArray(md5.digest());
    char[] result6 = toBase64(result);

    md5.reset();
    md5.update(hashStringC.getBytes());
    result = Util.byteArrayToCharArray(md5.digest());
View Full Code Here

Examples of java.security.MessageDigest.digest()

    result = Util.byteArrayToCharArray(md5.digest());
    char[] result6 = toBase64(result);

    md5.reset();
    md5.update(hashStringC.getBytes());
    result = Util.byteArrayToCharArray(md5.digest());
    char[] result96 = toBase64(result);

    String ret[] = new String[2];
    ret[0] = new String(result6);
    ret[1] = new String(result96);
View Full Code Here

Examples of java.security.MessageDigest.digest()

    // Add key again.
    md2.update(key.getBytes());

    // Now get result of this (16 bytes) and add it to the other context.
    byte[] altResult = md2.digest();

    // Add for any character in the key one byte of the alternate sum.
    int cnt;
    for (cnt = key.length(); cnt > 16; cnt -= 16)
      md1.update(altResult, 0, 16);
View Full Code Here

Examples of java.security.MessageDigest.digest()

  {
    MessageDigest md = MessageDigest.getInstance("MD5");

    md.update(str.getBytes());

    byte[] b = md.digest();
    StringBuffer sb = new StringBuffer();

    for(int i = 0; i < b.length; i++)
    {
      int v = (int) b[i];
View Full Code Here

Examples of java.security.MessageDigest.digest()

     */
    protected static String getSHA1(byte[] data) {
        MessageDigest md;
        try {
            md = MessageDigest.getInstance("SHA-1");
            return convertBytesToString(md.digest(data));
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }

View Full Code Here

Examples of java.security.MessageDigest.digest()

    private static String getSHA1(byte[] data) {
        MessageDigest md;
        try {
            md = MessageDigest.getInstance("SHA-1");
            return convertBytesToString(md.digest(data));
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of java.security.MessageDigest.digest()

                  byte[] encodedRecipient = ((PdfObject)recipients.getArrayList().get(i)).getBytes()
                  md.update(encodedRecipient);
                }
                if ((cryptoMode & PdfWriter.DO_NOT_ENCRYPT_METADATA) != 0)
                    md.update(new byte[]{(byte)255, (byte)255, (byte)255, (byte)255});
                encryptionKey = md.digest();
               
            } catch (Exception f) {
                throw new ExceptionConverter(f);
            }
        }
View Full Code Here

Examples of java.security.MessageDigest.digest()

    String validationKey = (String)properties.getProperty(LICENSE_FILE_SHA_KEY);
    try
    {
      MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
      messageDigest.update(validationStringBuffer.toString().getBytes());
      String newValidation = Base64.encode(messageDigest.digest());
      if (newValidation.equals(validationKey))
      {
        if (getMACAddress().equals(Settings.getInstance().getMACAddress()))
        {
          returnValue = true;
View Full Code Here

Examples of java.security.MessageDigest.digest()

      throw new ExceptionConverter(e);
    }
    long time = System.currentTimeMillis();
    long mem = Runtime.getRuntime().freeMemory();
    String s = time + "+" + mem + "+" + (seq++);
    return md5.digest(s.getBytes());
  }

  /**
   */
  public void setupByUserPassword(byte[] documentID, byte userPassword[],
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.