public static byte[] encryptKey(@NotNull byte[] password,byte[] rawKey){
  try {
    Cipher c=Cipher.getInstance(ENCRYPT_KEY_ALGORITHM);
    c.init(Cipher.ENCRYPT_MODE,new SecretKeySpec(password,SECRET_KEY_ALGORITHM),CBC_SALT_KEY);
    return c.doFinal(rawKey);
  }
 catch (  GeneralSecurityException e) {
    throw new IllegalStateException(e.getMessage(),e);
  }
}

public static byte [ ] encryptKey ( @ NotNull byte [ ] password , byte [ ] rawKey ) { try { Cipher c = Cipher . getInstance ( ENCRYPT_KEY_ALGORITHM ) ; c . init ( Cipher . ENCRYPT_MODE , new SecretKeySpec ( password , SECRET_KEY_ALGORITHM ) , CBC_SALT_KEY ) ; return c . doFinal ( rawKey ) ; } catch ( GeneralSecurityException e ) { throw new IllegalStateException ( e . getMessage ( ) , e ) ; } }
encrypt key ( does not use salting , so the encryption result is the same for the same input )
