Internet of Things (IoT) is a heterogeneous network of interconnected things where users, smart devices and wireless technologies, collude for providing services. It is expected that a great deal of devices will get connected to the Internet in the near future. Opportunistic networks(OppNet) are a class of disruption tolerant networks characterized by uncertain topology and intermittent connectivity between the nodes. Opportunistic Internet of Things(OppIoT) is an amalgamation of the OppNet and IoT exploiting the communication between the IoT devices and the communities formed by humans. The data is exposed to a wide unfamiliar audience and the message delivery is dependent on the residual battery of the node, as most of the energy is spent on node discovery and message transmission. In such a scenario where a huge number of devices are accommodated, a scalable, adaptable, inter-operable, energy-efficient and secure network architecture is required. This paper proposes a novel defense mechanism against black hole and packet fabrication attacks for OppIoT, GFRSA, A Green Forwarding ratio and RSA (Rivest, Shamir and Adleman) based secure routing protocol. The selection of the next hop is based on node’s forwarding behavior, current energy level and its predicted message delivery probability. For further enhancing the security provided by the protocol, the messages are encrypted using asymmetric cryptography before transmission. Simulations performed using opportunistic network environment (ONE) simulator convey that GFRSA provides message security, saves energy and outperforms the existing protocols, LPRF-MC (Location Prediction-based Forwarding for Routing using Markov Chain) and RSASec (Asymmetric RSA-based security approach) in terms of correct packet delivery by 27.37%, message delivery probability is higher by 34.51%, number of messages dropped are reduced by 15.17% and the residual node energy is higher by 14.08%.