Authors - C. Bagath Basha, S. Rajaprakash, K. Karthik, Panjala Vijay Goud, Macharla Rakesh, M Ramana Kumar Abstract - The privacy and security of sensitive information is a major concern in the social assistance sector due to the widespread use of Internet of Things technologies. This study presents a secure sharing algorithm for IoT social assistance data based on blockchain and smart contracts. It aims to address the inherent hazards of conventional centralized administration, such as data loss and manipulation. This paper propose a security method and this method has four process. There are four steps to the new method. First, change the text from plain text to “ASCII code” (A). The second step is to take the A values and make pairs. Then, swap the cells in the matrix so that the even pair numbers start from the 0th cell value and go to the end of the matrix. The third step is to use the “ASCII code” as C to find the prime number. To do the fourth step, you need to use Equation 1. Take the numbers from A1 and pair them up. Then, change the cells in the matrix The message is ultimately received in its original format via the process of decryption, which is thought of as the inverse of this conversion. The proposed technique provides a higher level of security when compared to more conventional encryption methods.