In Main:
public static void main(String[] args) throws NoSuchAlgorithmException { System.out.println(\"encrypt:\" + encryptPassword(\"superuser\")+\":\"
In case anyone needs this for any libraries using OkHttp, there's a Credentials class you can use for Base64 encoding your username/pass
Credentials
String credentials = Credentials.basic("username", "password"); request.header(HttpHeaders.AUTHORIZATION, credentials);