Given the nature (Credit Card Numbers) of the 16-digit decimal numbers, they include one Luhn check digit, and it is trivial to reconstruct any unknown digit from the 15 others. With their 6 first digits and 4 last digits assumed known, the remaining 6 digits have at most as much entropy as 5 decimal digits, that is $b=5\cdot\log_2(10)\approx16.6$ bit. The following generalizes to a short plaintext (say at most 100 bytes) with an unknown portion taking $2^b$ equally likely values trivially determinable from the rest of the plaintext, and would be adaptable to $b$ bit of entropy and a publicly known distribution, like a bias towards small values.
An unavoidable limitation is that, with access to the vault's internals (even without the detokenization credentials), partial information on a plaintext in the vault, and matching index, an attacker can repeatedly query candidate plaintexts (say sequentially from a random starting point) into a simulation of the vault, and check if the simulation is returning the index. Expected cost is that of $2^{b-1}$ tokenizations. Expected time is $2^{b-1}/n$ queries with $n$ simulations of the vault running in parallel at the same speed as the vault, for $n\ll2^b$. Thus one query to the vault must require significant work $W_q$ on average. If we are willing to wait 1 second per query to the vault, and have the vault consume 10 kW (about the design power of the NEMA 14-50 plug sometime used for charging an electric car) during that (bringing the cost of electricity alone to $\$0.0004$ at my home's rate), an attacker using the same hardware and rate could recover a plaintext every 5.8 days (at a cost of $\$200$ in electricity) per plaintext; and we should fear the adversary is significantly more efficient that we are. That is not satisfactorily safe by normal cryptographic standards, but better than nothing.
Another unavoidable limitation is that with access to the vault's internals, the detokenization credentials, and an index, an attacker can recover the plaintext for that index by the method used by the vault for detokenization. Thus one detokenization must require significant work $W_d$ on average. Say, if we're willing to spend 100 seconds per detokenization, and have the vault consume 10 kW during that, an attacker using the same hardware and rate can do so and recover each plaintext at that cost; and again we should fear the adversary is significantly more efficient than we are. That is not safe by any stretch of imagination, and I thus question the rationality of considering an adversary with simultaneously detokenization credentials, valid indexes, and partial information on plaintexts, as in the question right now.
Thus I first describe a system that disregards an adversary with detokenization credentials, but I think matches all the requirements as currently worded (including not holding a detokenization private key outside the vault, if that still allows a passphrase unknown to the adversary as detokenization credentials). I'll then sketch how to modify that to add any feeble resistance we can have against an adversary with detokenization credentials.
- At initialization:
- The vault is given a passphrase $P$, which subsequently will be required only for detokenization.
- The vault stretches $P$ into a 256-bit key $K$ using scrypt and constant salt $S$ unique to the vault; the parameters determining the amount of work (iterations, memory, number of threads/cores) are set for $W_d$.
- The vault deterministically generates an RSA key $(N,e,d)$, using as the necessary source of random bits a CSPRNG seeded with $K$.
- The vault stores the public key $(N,e)$ and zeroizes $P,K,d$ and any other intermediary result.
- The vault initializes its internal variable $I=0$, and an internal database to empty (that will hold one cryptogram per plaintext stored).
- At query:
- The vault deterministically and slowly turns the plaintext it receives into a cryptogram as follows:
- The vault applies scrypt with the plaintext as password, and some constant salt $S'$ unique to the vault, yielding a 256-bit result $R$; work parameters are set for $W_q$.
- The vault enciphers the plaintext into the cryptogram using RSAES-OAEP of PKCS#1v2, using as the necessary source of random bits a CSPRNG seeded with $R$.
- That cryptogram is searched in the database:
- If absent, it is stored in the database at index $I$; $I$ is incremented; and the former $I$ is returned as the index for the plaintext just stored.
- If present, its index is returned.
- At detokenization:
- The vault accepts the index to detokenize, and alleged passphrase $P$.
- The vault stretches the alleged $P$ into alleged $K$ as during initialisation.
- The vault deterministically generates the alleged RSA key $(N,e,d)$ from $K$ as during initialization.
- If the alleged $(N,e)$ matches the stored $(N,e)$, then
- if the index to detokenize is less than current $I$, then
- the vault fetches the cryptogram at the index, deciphers it using $(N,d)$, and outputs the plaintext.
- The vault zeroizes $P,K,d$ and any other intermediary result.
As pointed in comment, it is enough to use a moderate $N$ when $b$ is small, since the system can't be very safe anyway. Given use of RSAES-OAEP, $e=3$ is safe and allows to spend more effort in scrypt (but security authorities frown at $e=3$, thus we might bow and use $e=2^{16}+1$).
The system is such that it is twice safer for any extra unknown bit of information in the partial plaintext, which is a nice-to-have. I do not see that Y known plaintexts as in 5 of the question helps more than by allowing to weed out records corresponding to these Y plaintexts.
If we really want to present some symbolic resistance to an adversary with detokenization credentials, there are options. I'll assume $W_d/W_q\ll2^b$ (in any system, the contrary would be useless against any adversary also holding indexes and partial information on plaintexts, as assumed in the question). Sketch of one possibility:
- We modify query by enciphering, rather than the full plaintext, the plaintext excluding the secret portion $M$ (here of 6 decimal digits), which we replace with $M\bmod\lceil2^{b+1}\cdot W_q/W_d\rceil$ or other suitable hint giving $b+1-\log_2(W_d/W_q)$ bit of information about $M$.
- We modify detokenisation to recover the full plaintext by trying the about $2\cdot W_d/W_q$ candidates that remain (in random order or at least starting from a random point to avoid timing attacks), thus with expected work about $W_d$.
- We modify initialization and detokenisation to stretch $P$ into $K$ with work only a fraction of $W_d$.
Many improvements seem feasible, but I lack the energy to do more than list some:
- random-like indexes as in the question initially;
- reducing the memory used in the vault, e.g. by using a public-key cryptosystem with shorter cryptograms than RSA with small plaintext, or perhaps radically by creeping ciphertext in the indexes;
- allowing plaintext of arbitrarily large size, e.g. by using hybrid encryption;
- storing ciphertext outside the vault without compromising security;
- improved security against an adversary with detokenisation credentials but without the random-like indexes, or/and partial plaintext information.
Further, if we turned around the problem and removed the assumption that the vault is insecure, replacing that with say a security-evaluated Smart Card IC with redundant CPUs, or perhaps just an off-the-shelf Java Card or programmable HSM, we could have much enhanced security without drawing kilowatts during operation or requiring too much of a huge investment. In the simplest embodiment
- Initialization chooses an AES key at random; and initializes an 8-digit PIN.
- Query accepts the plaintext as 16 bytes in ASCII; waits as long as bearable; enciphers the plaintext using AES; outputs the 16-byte ciphertext as index (encodable as a 22-characters base-64 string);
- Detokenization checks the PIN code as familiar in bank Smart Cards and SIM cards, with an error counter, zeroizing the device after three consecutive failed attempts; accepts the index; waits as much as bearable; deciphers the index; and outputs the result.
Note: plaintext can be verified to be valid on Query and Detokenization; that can only help, by limiting the information that an adversary can get.