In Main:
public static void main(String[] args) throws NoSuchAlgorithmException { System.out.println(\"encrypt:\" + encryptPassword(\"superuser\")+\":\"
You just need to Use Base64 encoding in following way
Base64.encodeBase64String("Your data to encrypt in base64", Base64.DEFAULT)
Change above line with the followings
Base64.encodeBase64String("Your data to encrypt in base64",Base64.NO_WRAP)
It worked for me.