As AmitGajjar said, you should store the words somewhere, though I'd only store the eligible words (4 letters, non-repeating characters). The list of words is going to be large if you use a reasonable size dictionary, so you might consider partitioning on the first character (e.g. an "a" table, "b" table) etc if performance is bad.
One thing you can do to make your task easier is to use Linux's dictionary see here for the file location
]. You can easily write a perl script to process the file and emit all the eligible words into a new file (or files if you want to segregate by first letter). Then all you need do is get the words into your backing store, though you could use the text file(s) as your backing store.