The concept of Trust has been applied in many information systems such as e-commerce, social networks and smart grid networks. It is currently getting attention on the Internet of Things. The fundamental concept in Trust, is the ability of a user to evaluate its neighbour, or a recommended neighbour with the hope of being able to trust that user. In this paper, we propose SecTrust, which is a trust-based system that computes trust values as a time-based packet forwarding behaviour of a node in a peer-2-peer (P2P) network. It uses a trust rating iteration and rating scheme to select only trusted nodes for communication while isolating malicious nodes in the network. A penalty is also introduced in our system that penalizes the continuous misbehaviour of a node in the network. Simulation evaluation results show the superior performance of SecTrust over other trust systems in isolating malicious peers, improving information interaction success rates, enhancing trust formation, and promoting better reputation between trusted peer nodes.