| {SHA}ieSV55Qc+eQOaYDRSha/AjzNTJE= I found this online converter tool: http://hash.online-convert.com/sha1-generator There I entered the plaintext demo and got the following output: |
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
public class EncryptionTest {
public static void main(String[] args) {
String encrptedPW = "";
String pw = "demo";
encrptedPW = DigestUtils.sha1Hex(pw);
System.out.println("DigestUtils: " + encrptedPW);
byte[] encodedBytes = Base64.encodeBase64(encrptedPW.getBytes());
System.out.println("encodedBytes Base64: " + new String(encodedBytes));
}
}DigestUtils: 89e495e7941cf9e40e6980d14a16bf023ccd4c91
encodedBytes Base64: ODllNDk1ZTc5NDFjZjllNDBlNjk4MGQxNGExNmJmMDIzY2NkNGM5MQ==