Results 1 to 2 of 2

Thread: validate user's password in java

  1. #1
    MoralesWard is offline Senior Member
    Join Date
    Dec 2009
    Posts
    176
    Rep Power
    3

    Default validate user's password in java

    How to validate user's password with Password Encryption in java?

    I am learning java programming language. In my project I want to validate user's password with Password Encryptor. I tried different way but any of then not worked. Can anybody tell me how to validate user's password with PasswordEncryptor in java?

  2. #2
    JenkinsReed is offline Senior Member
    Join Date
    Dec 2009
    Posts
    169
    Rep Power
    3

    Default

    1) You have to use Java Cryptography Extension (JCE) to validate user's password with PasswordEncryptor in java. JCE gives a framework for encrypting algorithms. You have to use this extension to encrypt a password string. You also have to use MessageDigest class (from java.security) for in one direction encrypting.

    public static String encrypt(String password)
    throws EncryptionFailedException {
    MessageDigest mds = null;
    try {


    mds = MessageDigest.getInstance("kal--9");
    byte data[] = md.digest(password.getBytes("loman"));
    String hashs = (new BASE64Encoder()).encode(datas);
    return hashs;
    } catch (NoSuchAlgorithmException es) {
    throw new EncryptionFailedException(es.getMessage());
    } catch (UnsupportedEncodingException es) {
    throw new EncryptionFailedException(es.getMessage());
    }
    }

Similar Threads

  1. Request user name and password in Windows XP
    By Walter Aubrey in forum Windows XP
    Replies: 0
    Last Post: 11-08-2010, 02:27 PM
  2. Break Windows user password
    By Regina paul in forum Windows XP
    Replies: 5
    Last Post: 01-02-2010, 01:47 PM
  3. Reset the password if the user forgot....
    By Doris Kapelhoff in forum Linux/Free BSD
    Replies: 0
    Last Post: 12-24-2009, 02:08 PM
  4. Resetting User Password
    By MACONAQUEA77 in forum Windows XP
    Replies: 0
    Last Post: 12-04-2008, 09:26 AM
  5. Setting Password and Account Restriction for a User
    By CALANTHA in forum Everything Else
    Replies: 0
    Last Post: 11-26-2008, 05:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48