The problem I think lies in the definition of "ENGLISH".
My definition is:
#define ISENGLISH(a) ( ( (a) >= '0' && (a) <= '9' ) || ( (a) >= 'a' && (a) <= 'z' ) || ( (a) >= 'A' && (a) <= 'Z' ) || (a) == ' ' || (a) == '\n' || (a) == '\r' )
ie: Any letter that is 0-9. a-z, A-Z space or newline or carriage return is english.
However, my code fails to find a key (ie: No key from length 1 to 30 which can fit the message).
Some assumptions I made (please tell me if I'm wrong):
1) There is only one test data, max length of 30k chars.
2) Key length is 1 to 29 (I use 1 to 30 to be safe)
3) Key can only be a-z and 0-9 (total of 36 characters, no upper case)
If anyone has solved it and can help, please do. Thanks!
