This code is in java and it implements the Needham Schroeder Public Key Protocol and Lowe Protocol. The encryption part has been included in it.