In a cryptography system, client and server terminals each generate a private key constituting a randomized compilation of dynamic system parameters. Public keys are then generated based on the private keys, exchanged between the terminals, and used to generate a shared secret. Key stream generators generate a randomized key stream at each terminal using the shared secret, based on self-generating primitive polynomials. Key length is user selected, and may be modified during an ongoing encryption session. The generator includes a plurality of linear feedback shift registers whose lengths are self-configuring based on the user-specified key length. The registers are interconnected so that their output, namely, the key stream, is non-linear and random. Data is converted to binary form and encrypted by XOR'ing the binary-format data with the key stream. The system may be used in both a static secure transfer mode and a dynamic secure real time transfer mode.