I have been working on an NLP project (Natural Language Processing) regarding a variety of Arabic. I had to observe and look for patterns and rules in this variety as the resources are almost absent or very rare. I then started working on this module that classifies, tokenizes, stems, and returns the part-of-speech of each instance of the input. I'm afraid of the high possibility that one of my supervisors with such a history of stealing others work and labeling it as his. When I present my research, must I present the source code to the supervisor, or must I only live-experiment the model? I do not have a problem with distributing or open-sourcing the whole thing; I am willing to. But I am afraid he takes my work and make it his with no credits or rights.
The best way to protect your research from someone else taking credit is to publish it first. Even then, someone with a stronger reputation or more recognition can attempt to take credit for it. This is a risk you take in research and which is made worse by working with a supervisor "with such a history of stealing others work."
The more public your contributions are, the less likely someone else can steal it from you. If you have multiple supervisors make sure they are all aware of your contributions. Maybe talk with them about finding a chance for you to present at a poster session, conference, or research forum. Their names will likely be on the project (and probably deserve to be) if they are your supervisors, but yours will too.