public static void rot13(byte[] bytes, int offset, int length) {
    for(int i=offset; i < offset+length; i++) {
      if (bytes[i] >= 'A' && bytes[i] <= 'Z') {
        bytes[i] = (byte) ('A' + (bytes[i] - 'A' + 13) % 26);
      } else if (bytes[i] >= 'a' && bytes[i] <= 'z') {
        bytes[i] = (byte) ('a' + (bytes[i] - 'a' + 13) % 26);
      }
    }
  }
A simple input format that does a rot13 on the inputs
itests/util/src/main/java/org/apache/hadoop/hive/ql/io/udf/Rot13InputFormat.java