@Override public void reduce(Text key, Iterable<LongWritable> vals, Context context) throws IOException, InterruptedException { int s = 0; for (LongWritable lw : vals) s += lw.get(); String pt = key.toString() + " " + s; byte[] iv = crypto.randomBytes(AES_BLOCK_SIZE); byte[] ct = crypto.encrypt_word_rnd(pt, iv); context.write(new BytesWritable(iv), new BytesWritable(ct)); }