Java XML Data Type Converter encryptPassword(String unencrypted)

Here you can find the source of encryptPassword(String unencrypted)

Description

encrypt Password

License

Open Source License

Declaration

public static String encryptPassword(String unencrypted) throws NoSuchAlgorithmException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.xml.bind.DatatypeConverter;

public class Main {
    private final static String SHA_256 = "SHA-256";

    public static String encryptPassword(String unencrypted) throws NoSuchAlgorithmException {
        MessageDigest md = MessageDigest.getInstance(SHA_256);
        md.update(unencrypted.getBytes());
        return DatatypeConverter.printHexBinary(md.digest()).toLowerCase();
    }// w w  w.j  av a  2 s.c o m
}

Related

  1. deserializeLogic(String logicString)
  2. encodeBasicHeader(final String username, final String password)
  3. encodeDoubleArray(double[] noData)
  4. encodeJavaOpts(String javaOpts)
  5. encrypt(String plainText, String password)
  6. fetchUrl(String url, String username, String password)
  7. formatFriendlyName(final byte[] addressBytes)
  8. fromString(String s)
  9. fromStringSafe(final String s)