public String encryptPassword(){
  String nonce=getNonce();
  String timestamp=getUTCTime();
  String beforeEncryption=nonce + timestamp + password;
  byte[] encryptedRaw;
  try {
    encryptedRaw=sha1(beforeEncryption);
  }
 catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
    return null;
  }
  String encoded=Base64.encodeBase64String(encryptedRaw);
  return encoded;
}

public String encryptPassword ( ) { String nonce = getNonce ( ) ; String timestamp = getUTCTime ( ) ; String beforeEncryption = nonce + timestamp + password ; byte [ ] encryptedRaw ; try { encryptedRaw = sha1 ( beforeEncryption ) ; } catch ( NoSuchAlgorithmException e ) { e . printStackTrace ( ) ; return null ; } String encoded = Base64 . encodeBase64String ( encryptedRaw ) ; return encoded ; }
returns encrypted version of given password like algorithm like in ws - usernametoken
