Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I do not really understand the meaning of a "trapdoor" in cryptography, so here are my questions:

  • What is the meaning of trapdoor and how can I convert a word or string using a trapdoor in cryptography?
  • Is a hash function considered to be a trapdoor function, or is a trapdoor function some kind of encryption?
  • What is the result of trapdoor function, a numeric or a string result?
  • What does trapdoor itself mean? Does it mean a private key is used in a trapdoor function or does it point to the string after transmission?

It would be nice if you could explain with examples.

share|improve this question
Have you read the associated Wikipedia Article? If so, what parts of it are you having difficulty with? – Reid Aug 30 '13 at 18:17
yes I did, but I want to know if this function type of encryption mechanisms, and if I want to convert word(string) using trapdoor function what is the result? , and Is hash function consider trapdoor function? – shsa Aug 30 '13 at 20:27

A trapdoor function is a function that is easy to perform one way, but has a secret that is required to perform the inverse calculation efficiently. That is, if $f$ is a trapdoor function, then $y = f(x)$ is easy to compute, but $x = f^{-1}(y)$ is hard to compute without some special knowledge $k$. Given $k$, then it is easy to compute $y = f^{-1}(x, k)$. The Wikipedia article also contains a straight-forward explanation.

The analogy to a "trapdoor" is something like this: It's easy to fall through a trapdoor, but it's very hard to climb back out and get to where you started unless you have a ladder.

A hash function is not a trapdoor function because it is not reversible. Instead, it's called a one-way function. A one-way function is similar to a trapdoor function in that it's easy to compute both and it's very hard to reverse both, but there is no special key that allows you to reverse the one-way function.

To compare the definitions of one-way and trapdoor functions, I double-checked teaching sources I'm familiar with, including:

They all categorize (sometimes implicitly) trapdoor functions as a subset of one-way functions: Trapdoors are a one-way function with the extra restriction that they have a secret for calculating the inverse.

For example: RSA is a one-way trapdoor function, but SHA-1 is just a one-way hash function. Discrete exponentiation is also (supposedly) just a one-way function, since there's no key information about the group that can be used to calculate the discrete logarithm efficiently.

That said, on a pragmatic note I have noticed that common Internet usage often mixes the terms "one-way" and "trapdoor" interchangeably, which no doubt causes confusion.

share|improve this answer
In you explanantion of a One-way function, shouldn't it be: x=f^-1 (y,k) instead of y=f^-1(y,k) ? – user29705 Dec 8 '15 at 13:12
From Wikipedia: difficult to compute in the opposite direction (finding its inverse) without special information, called the "trapdoor". So, I think trapdoor is actually a secret way to finding the inverse. – Ujjwal Ojha Jul 25 at 5:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.