Cryptosystems are not based on NP-hard problems. There are several standard hardness assumptions in cryptography on which cryptographic primitives are based, and cryptosystems are constructed based on cryptographic primitives, whose existence is thus assumed.
An example of a hardness assumption is DDH (Decisional Diffie–Hellman): given a prime $p$ and a generator $g$ of $\mathbb{Z}_p^\times$, it is hard to distinguish triples $(g,g^x,g^y,g^{xy})$ (for random $g$ generating $\mathbb{Z}_p^*$ and random $x,y \in \mathbb{Z}_{p-1}$) from triples $(g,g^x,g^y,g^z)$ (for random $g$ generating $\mathbb{Z}_p^*$ and random $x,y,z \in \mathbb{Z}_p$).
An example of a cryptographic primitive is a one-way function. While the various definitions of one-way functions are somewhat intricate, informally a one-way function is a function that is easy to compute but hard to invert. One such example is $x \mapsto g^x \pmod{p}$, and assuming DDH, you can construct a secure one-way function based on this idea.
Cryptosystems, in turn, are composed out of cryptographic primitives satisfying some security assumptions, such as the one just mentioned: a one-way function is hard to invert. The primitives, in turn, are based on their own security assumptions, like DDH. The latter are different from NP-hardness in an important way: what is needed is average-case hardness rather than worst-case hardness.
Real-world cryptosystems are not usually based on this theory, their security being based on their designers (and then other cryptologists) not being able to break them. This seems to work rather well in practice.