1. A computer-implemented method of detecting null-byte injection, comprising executing, on at least one processor, the steps of: generating an output finite-state machine using a set of directed graphs, wherein each one of the directed graphs in the set corresponds to a singly encoded null-byte that is encoded according to a corresponding one of a set of character encoding methods, and wherein the output finite-state machine models computation for detecting at least one multiply encoded null-byte, the multiply encoded null-byte encoded according to at least one of the character encoding methods contained in the set of character encoding methods; loading the output finite-state machine into an attack detection and prevention system; receiving, by the attack detection and prevention system, at least one input text; and detecting, by the attack detection and prevention system in response to the output finite-state machine loaded in the attack detection and prevention system and the input text, an instance of the multiply encoded null-byte within the input text.