I solved this problem by writing a Groovy script (in a fake test suite/test case) that parses the project XML file, removes/replaces nodes with sensitive data, such as authentication profiles and properties with user names and passwords, and saves a copy of the file.
Sorry, can't post the code, but each step in the above process has a straightforward solution that can be looked up/googled.
Thank you for your question. Felt somehow the question is interesting.
Here is what it is:
It is script, and best fit is to use it in Save Script at Project level. That means, the code is natural fit here as you want to save the project before giving to whom so ever by clearing the property values. So, copy the provided script into Save Script at Project level. As name says all, the script gets executed automatically when the project is saved.
The next question would be "I am working on this project and wish this script to be run on demand only, not just on saving the project".
Don't have to worry if you just run the script based on some condition.
Say, define Project level property CLEAR_PROPERTIES and set its value as false while you are working on the project. It won't clear your data though the project is saved any number of times.
Once the project is ready and you want to provide it to different parties and that's when you need to clear those data. Now, just change the CLEAR_PROPERTIES value to true. And save the project. And see the magic!!