Secret sharing scheme is a method in which the secret is divided among finitely many participants by a dealer such that only the legitimate set of participants can recover the secret. The collection of sets of legitimate participants is called the access structure of the secret sharing scheme. There are various ways of constructing secret sharing schemes. Determination of the access structure for a secret sharing scheme is an important problem. Most of the known secret sharing schemes are based on linear codes. A major drawback of secret sharing schemes based on linear codes is that these schemes are susceptible to Tompa-Woll attack. In this paper, we use nonlinear codes to construct secret sharing schemes. These secret sharing schemes perform better than the secret sharing schemes based on linear codes with respect to Tompa-Woll attack.