Examples of doFinal()


Examples of bm.core.tools.MD5Digest.doFinal()

    {
        MD5Digest md5 = new MD5Digest();
        final byte[] data = password.getBytes();
        md5.update( data, 0, data.length );
        final byte[] digest = new byte[16];
        md5.doFinal( digest, 0 );
        this.password = digest;
    }

    public synchronized void load()
            throws DBException
View Full Code Here

Examples of com.dotcms.repackage.org.bouncycastle.crypto.digests.SHA1Digest.doFinal()

  private static String hashPath(String path) {
    byte[] data=path.getBytes();
    SHA1Digest digest=new SHA1Digest();
    digest.update(data, 0, data.length);
    byte[] result=new byte[digest.getDigestSize()];
    digest.doFinal(result, 0);
    String ret=null;
    ret=new String(Base64.encode(result));   
    return ret;
  }
 
View Full Code Here

Examples of com.maverick.crypto.digests.Hash.doFinal()

            // H( unq(username-value) ":" unq(realm-value) ":" passwd )
            // ":" unq(nonce-value)
            // ":" unq(cnonce-value)

            hash.putBytes(a1.getBytes("US-ASCII")); //$NON-NLS-1$
            String tmp2 = encode(hash.doFinal());
            StringBuffer tmp3 = new StringBuffer(tmp2.length() + nonce.length() + cnonce.length() + 2);
            tmp3.append(tmp2);
            tmp3.append(':');
            tmp3.append(nonce);
            tmp3.append(':');
View Full Code Here

Examples of com.maverick.crypto.digests.MD5Digest.doFinal()

                ctx.update(password.getBytes()[0]);
            }
        }

        finalState = new byte[ctx.getDigestSize()];
        ctx.doFinal(finalState, 0);

        /*
         * and now, just to make sure things don't run too fast On a 60 Mhz
         * Pentium this takes 34 msec, so you would need 30 seconds to build a
         * 1000 entry dictionary...
View Full Code Here

Examples of com.maverick.crypto.digests.SHA1Digest.doFinal()

      signature = signatureInt.toByteArray();

      SHA1Digest h = new SHA1Digest();
      h.update(msg, 0, msg.length);
      byte[] data = new byte[h.getDigestSize()];
      h.doFinal(data, 0);

      if(data.length != (signature.length - ASN_SHA1.length)) {
        return false;
      }
View Full Code Here

Examples of com.maverick.crypto.engines.DESEngine.doFinal()

     * @throws HttpException If {@link Cipher.doFinal(byte[])} fails
     */
    private byte[] encrypt(byte[] key, byte[] bytes) throws IOException {

        DESEngine cipher = getCipher(key);
        byte[] enc = cipher.doFinal(bytes);
        return enc;

    }

    /**
 
View Full Code Here

Examples of com.sshtools.j2ssh.util.Hash.doFinal()

        try {
            // Generate the key using the passphrase
            Hash md5 = new Hash("MD5");
            md5.putBytes(passphrase.getBytes());

            byte[] key1 = md5.doFinal();
            md5.reset();
            md5.putBytes(passphrase.getBytes());
            md5.putBytes(key1);

            byte[] key2 = md5.doFinal();
View Full Code Here

Examples of com.twmacinta.util.MD5.doFinal()

     */
    public byte[] md5It(String s) {
        byte bb[] = new byte[16];
        try {
            MD5 md2 = new MD5(s.getBytes());
            return md2.doFinal();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return bb;
View Full Code Here

Examples of de.rtner.security.auth.spi.MacBasedPRF.doFinal()

    PBKDF2Engine engine = new PBKDF2Engine(new PBKDF2Parameters("HMacSHA1", null, serverSalt, Integer.parseInt(iterationCount)));
    byte[] saltedPassword = engine.deriveKey(password, 20);

      // ClientKey       := HMAC(SaltedPassword, "Client Key")
    hmac.init(saltedPassword);
    byte[] clientKey = hmac.doFinal("Client Key".getBytes());

    // StoredKey       := H(ClientKey)
    byte[] storedKey = md.digest(clientKey);

      // AuthMessage     := client-first-message-bare + "," +
View Full Code Here

Examples of javax.crypto.Cipher.doFinal()

        encrypt.down(event);
        Message sentMsg=(Message)((Event)observer.getDownMessages().get("message0")).getArg();
        String encText=new String(sentMsg.getBuffer());
        assert !encText.equals(messageText);
        Cipher cipher=encrypt2.getSymDecodingCipher();
        byte[] decodedBytes=cipher.doFinal(sentMsg.getBuffer());
        String temp=new String(decodedBytes);
        System.out.println("decoded text:" + temp);
        assert temp.equals(messageText);

    }
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.