Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of detection of, or exposure to, a hyperosmotic environment, i.e. an environment with a higher concentration of solutes than the organism or cell. (Gene Ontology, GO_0006972)