class GrapesAuthenticator implements Authenticator<BasicCredentials, DbCredential> {

    public static String encrypt(final String password) throws AuthenticationException {
        String hashValue;
        try {
            final MessageDigest msgDigest = MessageDigest.getInstance("SHA");
            msgDigest.update(password.getBytes("UTF-8"));
            final byte rawByte[] = msgDigest.digest();
            hashValue = new String(Base64.encodeBase64(rawByte));

        } catch (Exception e) {
            LOG.error("Encryption failed.");
            throw new AuthenticationException("Error occurred during password encryption", e);
        }

        return hashValue;
    }

    public  GrapesAuthenticator(final RepositoryHandler repoHandler);

}