It sounds like you have a public store for some data, and you want to use it to store a set of secret elements, with the following operations:
- Add a new element to the set.
- Query whether an existing element is in the set.
(I'll assume that this is where the story ends—if you're actually trying to do some kind of authentication, there may be substantially more to it. I'll also assume that you already have a mechanism for authenticating changes to the set, and your main concern is to prevent disclosure of the elements of the set.)
If the party that needs to perform these operations can additionally keep secrets, say a 256-bit secret key $k$, then instead of storing an element $e$, you could store a secret pseudorandom function of $e$, such as $\operatorname{HMAC-SHA256}_k(e)$. Computing $\operatorname{HMAC-SHA256}_k$ requires knowledge of $k$; nobody without $k$ can tell the difference between your set of hashes and a set of independent uniform random 256-bit strings.
However, compromise of $k$ would enable anyone to verify elements of the set, enabling dictionary searches and batch speedups like rainbow tables. If you're concerned with compromise of $k$ in addition to disclosure of the list of hashes, you could:
- Use a password hash like Argon2id instead of HMAC-SHA256 to raise the cost of testing guesses.
- Use a Bloom filter rather than a list of hashes. This raises the false positive rate for membership tests from totally negligible (at most $n/2^{256}$ when there are $n$ elements) to something you have to worry about based on the Bloom filter parameters, but it also gives an adversary less to work with by not even exposing individual hashes to attack—raising the probability of false successes for the adversary.