I'm a masters degree student trying to figure out how publications and co-authorship work. I know that the school/PI retains legal ownership of any monetary profits that may result from the work, so please don't mention this in your response as it is irrelevant to what I'm asking. I WANT TO BE PUBLISHED AND DO NOT CARE ABOUT MONEY. I just want to ensure that I get academic credit/recognition this time since some of my work was previously passed off as another student's work in a different lab. I'm concerned because the new PI and another professor working on the project seem to want me to do all the grunt work/data collection, but according to the previous student that worked on the project, they prefer to keep the analysis to themselves even though I'm willing [to try] to learn how to do this myself... What protections do student have against others taking credit for their work, not giving them even partial credit/co-author status, and/or allowing another student to take credit who didn't help? Should I mail copies of my data to myself and retain a sealed copy? How do/did (when you were a grad student) you guys protect yourselves? Please list some measures/methods you use to prove that work you did was done by you as opposed to someone else in the lab. As things stand now, it seems like my PI, in theory, could hand over my work to another student who he likes more, who's viewed as younger/more promising, or who has a rich/important Daddy. Not saying he'd do this, but hey, its happened to me before, so yeah - just looking for some solid concrete measures I can implement to protect myself. I don't feel comfortable discusses this with my PI for reasons that should be obvious to anyone with a modicum of common sense, so please don't refer me to my PI. If you can't/don't want to help, fine, but please don't down vote me as somebody else may have some insight that would help me. Thanks.
In my experience, the best way to ensure that you get appropriate credit for your work is to work with trustworthy people.
Now, whether somebody is trustworthy is not always easy to determine (especially for a new graduate student), and there are also both genuine mistakes and genuine differences of opinion and criteria that often occur.
Nevertheless, there's a good heuristic that can help you test the waters early. You can lay claim to your work by finding opportunities to share early results. If you're in a software-related area, you can keep your projects on GitHub, where there's a nice public record of everything. If you're in a more experimental area or if sharing on GitHub doesn't work, then there should be opportunities with student conferences, internal group meetings, etc., to present work, even in early stages. These often exist explicitly for students to get feedback on work that's not yet ready for a proper publication, so the stakes are low. And even if it's an internal presentation rather than to the general scientific public, that will still greatly expand the group of people who know what you've done and what sort of value you're contributing.
If you get encouragement and opportunities, that's a good sign; if you get ongoing evasions and push-back, that's a bad sign.
Bottom line: the best way to ensure you get credit for publishing is to start "trial publishing" as soon as you've got interesting work to share, and see if you're in a supportive culture or a controlling one.
There are likely to be policies protecting trainees at your institution, and you should review those - including process for lodging complaints about scientific misconduct (which could apply to some of the behaviours you are worried about).
You should also review policies about handling of data (of the sort your work with) to be sure that taking raw data off-campus is allowed (in a medical center, for example, this could be grounds for dismissal even of a Professor); honestly, some of your ideas for self-preservation seem bizarre.
Constant worry about being scooped will not serve you well in an academic career; there are no guarantees but if you demonstrate integrity and earn the respect of others, you will be in a much better place to address unfair treatment if it occurs.
First of all I just want to note that your school very likely retains legal ownership of any monetary profits that may result from your work.
As for students plagiarizing, it happens but I wouldn't worry about unless it happens and you need to deal with it. I've never dealt with a plagiarizer who was smart enough to continue fooling people once they were investigated. The main problems arise where they are two sides to the story, i.e. not overt plagiarism, but where both of you worked on the results. Then most of your ideas for how to protect yourself won't work anyway since there will be conflicting evidence to create doubt.
As for faculty stealing the credit, this is basically hopeless. The advisor indeed has the power to do everything you fear they might do, and you have no power to stop them. You are there to be taught by them as a subordinate. They are both your supervisor and evaluator. You need them to be on your side, where they think you are an asset and want you to succeed and get credit you deserve. Research is very much a social-network-based system so you need them for a lot more than just a fair supervisor. As others said, choose carefully.