code: public static byte[] encrypt(byte[] text, Key key) throws EncryptionException {
          return encrypt(text, key, key.getAlgorithm());
      }
docs: Encrypts the given data using the given key. The key holds the algorithm used for encryption. If you are
  encrypting data that is supposed to be a string, consider that it might be Base64-encoded.
  
  @throws EncryptionException if the string cannot be encrypted with the given key