17. A method for text language identification comprising: receiving encrypted resources from an associated server, the encrypted resources comprising, for each of a plurality of languages, an encrypted frequency for each of a set of n-grams, the encrypted frequencies having been generated with a key for a homomorphic addition scheme; generating doubly-encrypted resources from the encrypted resources by further encrypting at least some of the encrypted frequencies with a key for a homomorphic multiplication scheme and obfuscating corresponding n-grams in the set of n-grams; extracting a list of n-grams from a text; obfuscating the n-grams in the list of n-grams; providing the doubly-encrypted resources and obfuscated list of n-grams to the server; receiving a doubly-encrypted score for each of the languages from the server computed based on the obfuscated list of n-grams and the respective doubly-encrypted resource; decrypting the doubly-encrypted scores with a key for the homomorphic multiplication scheme to generate encrypted scores; returning the encrypted scores to the server; receiving information from the server based on unencrypted scores generated by the server from the encrypted scores; and identifying a language from the plurality of languages for the text based on the received information, wherein at least one of the generating doubly-encrypted resources and the decrypting of the doubly-encrypted scores is performed by a processor.
18. The method of claim 17 , wherein the obfuscation of the n-grams in the set of n-grams and in the list of n-grams is performed with a same hashing algorithm and a same hash key.