Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7666459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:50:17+00:00 2026-05-31T14:50:17+00:00

For a system I’m designing, I want to be able to verify whether a

  • 0

For a system I’m designing, I want to be able to verify whether a specific string is ‘valid’ or not, but I want to keep my database of ‘valid’ strings private.

I want to provide clients with a database of all valid strings, but this database is (one-way) encrypted. I’m reluctant to distributing a key to the client, since there are always ways to obtain that specific key from the assembly code of my program (I presume).

Clients must be able to enter strings into my program and it would return a boolean based on the presence of the string in my encrypted file.

More importantly, I want my program to easily check whether the string is in the file, but I want to prevent other programs from easily using (and/or reconstructing) the database.

I have formulated this a bit abstract, because I don’t really know how my system will be looking yet, but I want to know whether something like this would be possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:50:18+00:00Added an answer on May 31, 2026 at 2:50 pm

    What you’re looking for are cryptographic hash functions! MD5 and SHA1 are well known examples, but if you’re building new code without strict performance constraints, SHA256 would be the one to chose, and if you’re looking to make it very difficult to recover the original words, you might want to consider scrypt or bcrypt (although they aren’t as popular and unlikely that your language will include them in the standard library).

    Then your database can be as simple as an unordered set of hashes, something like (in Python):

    >>> words = ["secret", "hidden"]
    >>> db = set([hashlib.sha256(word).hexdigest() for word in words])
    >>> db
    set(['2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b', 'e564b4081d7a9ea4b00dada53bdae70c99b87b6fce869f0c3dd4d2bfa1e53e1c'])
    >>> def word_exists(word):
    ...     return hashlib.sha256(word).hexdigest() in db
    ...
    >>> word_exists("hello")
    False
    >>> word_exists("hidden")
    True
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
system(ssh test.host.com); its asking for permentaly add key or not ? I want automatically
System works on windows but not Linux. I can login ok and list data
System.IO.Directory.GetFiles() returns a string[] . What is the default sort order for the returned
System.Environment.OSVersion does not appear to indicate which Edition of Windows 2003 is installed (Standard,
System.NullReferenceException: Object reference not set to an instance of an object. Making the Sitemap.CurrentNode
System.out.println((26.55f/3f)); or System.out.println((float)( (float)26.55 / (float)3.0 )); etc. returns the result 8.849999. not 8.85
System.Reflection does not (AFAIK) support reflecting on global methods in an assembly. At the
System.Windows.Forms.Form has only one scroll event- Scroll , but it is necessary to recognize
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.