Hi Deepti
It depends on the environment and your leadership. When you have good leadership qualities and if you stand separate or impress other bosses above your immediate boss, then there is lot of scope to come out this problem
Secondly, lady employee might not get along with a lady boss.. If your boss is lady, then you have to use some other method to get your talents noticed by other senior bosses
Don't bad mouth the boss, it may backfire.. So play safely
If the organisation's environment is not good, then bosses like this will have more upper hand and you cannot overcome them... Only where there is transparency and good work culture, the credit will go the right person.. If you feel everyone is like this in this company, then you have to look for a place in some other company or change in department here itself where you can get recognised.
I feel, if you improve your leadership skills and ensure that you are noticed by other heads also as a sincere and brilliant worker, then you might have a chance to get credit. Eg. Your boss may have to disclose who did it if your boss's boss happens to ask more doubts on what you do.
Preferably keep all the work done documented. May be you can send all inform what you prepare by email, so that there is a proof who has done it
May be you can try it out
Kavya