Package bm.core.tools

Examples of bm.core.tools.MD5Digest


     * not stored).
     * @param password clear text passsword
     */
    public void setPassword( final String password )
    {
        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;
    }
View Full Code Here


     * @throws DBException on error storing the password
     */
    public static void storeEncryptedPassword( final String password )
            throws DBException
    {
        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 );
        final LoginInfo info = getLoginInfo();
        info.password = digest;
        info.save();
    }
View Full Code Here

        final byte[] stored = info.password;
        if( stored != null )
        {
            if( stored.length == 16 )
            {
                MD5Digest md5 = new MD5Digest();
                final byte[] data = challenge.getBytes();
                md5.update( data, 0, data.length );
                final byte[] digest = new byte[16];
                md5.doFinal( digest, 0 );
                for( int i = 0; i < 16; i++ )
                {
                    if( stored[i] != digest[i] )
                    {
                        return false;
View Full Code Here

TOP

Related Classes of bm.core.tools.MD5Digest

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.