It's not in your interest to give a potential employer a number--ever. I've been on both sides of the table in this situation.
When I was younger, I once gave a number. I later received an offer with that number on it, which I happily accepted. Even later still, I discovered I could have named an amount twice that number. My employer couldn't believe how fortunate they were. I ended up working with one or two people who were way less competent than I was who were earning way more than I was. Plus, as a consequence, my contribution was not sufficiently valued by upper management with many of the assignments I would have found more interesting going to others. On more than one occasion, I was given only hours to completely rewrite something that an incompetent colleague had been given weeks or months to screw up.
I have sat on the other side of the table asking prospective employees what their salary requirements were, and I have received answers that were half or less of what I expected them to say. I found myself in the position of thinking: "Poker face, Bob! Poker face!"
I have signed contracts and employee agreements where rate or salary were strictly confidential and others where they were not. I cannot be bothered to hunt down every past contract so whenever I am asked, I simply respond with "I am not at liberty to say." While I have never had anyone continue to press for an answer after that response, if anyone did, I would simply point out they wouldn't want me betraying their confidences so please don't ask me to betray anyone else's.
In this industry, there are always lots of open jobs, and even more jobs advertised. If an ad says they won't consider applications without salary history and/or salary requirements, I don't waste their time or mine: I do not apply.
I assume all of those ads are simply trying to survey the market for salary expectations, in any case. It's not like any law prevents someone from just making up a job advertisement for a job that doesn't exist. HR departments and pimps do that all the time.
The pimps, in particular, and many larger businesses often buy advertising space in bulk. If they don't have a current job opening to fill that space, they won't hesitate to advertise a job they already filled in the past or to make up a job just to test the market for availability and price.
The companies doing the hiring know the market for the jobs they fill. HR departments subscribe to salary surveys costing hundreds or thousands of dollars per year. Plus, they conduct their own research, and they know what other people in the company doing the same job earn. They are much better informed than you are or will ever be.
They already know the maximum they will offer. You cannot ever increase that maximum. By providing a number -- any number at any point in the negotiation -- you can only decrease it.
Years ago, there was an excellent essay online describing exactly how to handle salary during negotiations. Sadly, I cannot find it right now. Basically, it described the following steps:
The first time the interviewer asks, respond with "I am much more interested in <insert description of what you are looking for> than in the amount of an initial offer."
I like "working with other smart people solving difficult challenges" so I insert that. The answer deflects the question, lets the employer know why you might want to work for the company, and tells the employer you understand negotiation means initial offers are not necessarily final offers.
The second time the company asks, respond with "You are in a much better position to know what value I can offer your company."
This response deflects the question again and puts the company on notice that you are well aware just how much better informed they are than you are.
The third, fourth and any subsequent time they ask, repeat the response from 2 above or combine 1 and 2 together.
The response deflects the question again and -- eventually -- with enough repetition, they will accept that you are not going to give them a number.
If the company gives you a lowball offer below what you will accept, thank them for their interest, explain why you think you add much more value than that, explain that you are not interested at that price, and tell them if they have a better offer to give, you will be happy to consider it.
If they ask how much more, give the same answer as 2 above. If they press, give the same answer as 2 above and add "If that was your best offer, I won't waste any more of your time."
If they haven't made their best offer yet, they still know what their best offer is and can make it. If they already made their best offer, you are already done. They are only asking to get another data point for their research. You get nothing out of giving them a number, and if you remain firm, the worst case is you get a data point for your research.
I understand how difficult it can be to not give the answer they ask for. Often, after giving one of the answers above, an interviewer will just remain silent. So just remain silent too. Out-wait them. If it gets to the point where you just have to say something, if the interview is on the phone, ask if they are still there or if the line was disconnected. If face to face, ask if they are okay or if they are having a seizure or something. But wait a very long time before saying either of those things.
In short, don't ever give them a number, and don't ever offend them with your refusal.