A desirable property of one-way functions is that they be total, one-to-one, and onto-in other words, that they be permutations. We prove that one-way permutations exist exactly if P ≠ UP ∩ coUP. This provides the first characterization of the existence of oneway permutations based on a complexity-class separation and shows that their existence is equivalent to a number of previously studied complexity-theoretic hypotheses. We also study permutations in the context of witness functions of nondeterministic Turing machines. A language is in PermUP if, relative to some unambiguous, nondeterministic, polynomial-time Turing machine accepting the language, the function mapping each string to its unique witness is a permutation of the members of the language. We show that, under standard complexity-theoretic assumptions, PermUP is a nontrivial subset of UP. We study SelfNP, the set of all languages such that, relative to some nondeterministic, polynomial-time Turing machine that accepts the language, the set of all witnesses of strings in the language is identical to the language itself. We show that SAT ∈ SelfNP, and, under standard complexity-theoretic assumptions, SelfNP ≠ NP.