private static byte[] crypt(byte[] msg,BigInteger n,BigInteger exp) throws BadPaddingException {
  BigInteger m=parseMsg(msg,n);
  BigInteger c=m.modPow(exp,n);
  return toByteArray(c,getByteLength(n));
}

private static byte [ ] crypt ( byte [ ] msg , BigInteger n , BigInteger exp ) throws BadPaddingException { BigInteger m = parseMsg ( msg , n ) ; BigInteger c = m . modPow ( exp , n ) ; return toByteArray ( c , getByteLength ( n ) ) ; }
rsa public key ops . simple modpow ( ) .
