A dream with a key suggests that you want to be free from a stressful situation, you are experiencing authority or power issues, you're being protective, or keeping parts of yourself or your ideas hidden away.
Alternatively, the dream may imply you're feeling anxious or excited, you're finding out secrets, you're exploring new opportunities or creativity, or you're looking for guidance or solutions.
An ordinary key can represent a simple solution to a problem, whereas an intricate style key can represent a more complicated solution to a problem. A group of keys can represent accomplishment, responsibility, and potential.
If you find a key then it suggests that you are open to gaining wisdom or spiritual knowledge, you are looking for a solution or answer to something, or you're exploring possibilities or ideas.
To give someone a key implies that you are handing over your responsibility to another person in some part of your waking life.
If you lose or cannot find a key in the dream then it implies that you have self-doubts, you are unprepared for something, you lack control in some part of your waking life, or you need to wait for the right time for something.
To have trouble using a key in a lock or a key that doesn't fit suggests that you feel opportunities are not within your reach, you are feeling frustrated, or having relationship issues.