Maybe you could look at compiling decryption into Tesseract. I'm no expert but it looks like the words are read in from a file name here:
https://github.com/tesseract-ocr/tesseract/blob/7b5b16779ad4980936724e85a548bccb717cc39c/dict/dict.cpp line 267 if (!trie_ptr->read_and_add_word_list(name.string(), getUnicharset(), which is a Trie instance function read_and_add_word_list https://github.com/tesseract-ocr/tesseract/blob/690616279c9acb4d82ca6e3f1539ec756cf12a9a/dict/trie.cpp Trie::RRP_REVERSE_IF_HAS_RTL)) { which uses function read_word_list You could add some decryption there before Trie parses it? Cheers On 8 December 2016 at 10:45, Piotr Szperka <[email protected]> wrote: > Thank you fro your respond @Allistar C > > Sadly it means, that I must keep user-words file decrypted during OCR > process, what means almost constantly for me :( > My legal regulations preventing me from storing my words decrypted. I can > have decrypted words only in my app code. > > W dniu czwartek, 8 grudnia 2016 09:51:10 UTC+1 użytkownik Allistair C > napisał: >> >> Not sure it can but I wondered whether the scope of your legal regulation >> would allow: >> >> 1. Encrypt the user words file or store in your source code >> 2. In you wrapper program just before tesseract api init decrypt the file >> to tessdata >> 3. Init tesseract pointed to this file >> 4. Perform ocr >> 5. Delete the decrypted file >> >> It does mean there is a temporary vulnerability but it's one idea if you >> don't find a native way to do this with tesseract. >> >> Cheers >> >> Sent from my iPhone >> >> On 8 Dec 2016, at 07:35, Piotr Szperka <[email protected]> wrote: >> >> Hello, >> I have a question about loading my own words. I can't save my words in >> unencrypted eng.user-words file due to legal reasons. I need some way to >> load it directly to Tesseract or read from encrypted file. I use C# >> wrapper, but firstly I must know if it is even possible? >> >> Thanks, >> Peter >> >> -- >> You received this message because you are subscribed to the Google Groups >> "tesseract-ocr" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/tesseract-ocr. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/tesseract-ocr/9b30528c-fec4-4a68-bc10-6f1d58ca5941%40googlegroups.com >> <https://groups.google.com/d/msgid/tesseract-ocr/9b30528c-fec4-4a68-bc10-6f1d58ca5941%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> >> -- > You received this message because you are subscribed to the Google Groups > "tesseract-ocr" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/tesseract-ocr. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/tesseract-ocr/ef501e7b-ce56-42e3-8281-3cf48c18cbf7% > 40googlegroups.com > <https://groups.google.com/d/msgid/tesseract-ocr/ef501e7b-ce56-42e3-8281-3cf48c18cbf7%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tesseract-ocr. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/CAORW5vgjnzq0vfgMQ2vppZCG34pH%2BB-NJCKUxFKn1JABLsKq%3DQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

