Mobile agent technology offers a new computing paradigm in which a program, in the form of a software agent, can transfer its execution from agent to agent masquerading itself as the original source of message. The use of mobile code has a long history dating back to the use of remote job entry systems in the 1960's. Today's agent incarnations can be characterized in a number of ways ranging from simple distributed objects to highly secured software with algorithm that can only be interpreted by only the sender and the receiver. As the sophistication of mobile software has increased over time, so too have the associated threats to security. This paper studies masquerading as one of these threats and provide appropriate solution in form of algorithm.