Based on a stream encryption scheme with avalanche effect (SESAE), a stream encryption scheme with both key avalanche effect and plaintext avalanche effect (SESKPAE) is introduced. Using this scheme and an ideal [Formula: see text]-word ([Formula: see text]-segment) pseudorandom number generator (PRNG), a plaintext can be encrypted such that each bit of the ciphertext block has a change with the probable probability of [Formula: see text] when any word of the key is changed or any bit of the plaintext is changed. To that end, a novel four-dimensional discrete chaotic system (4DDCS) is proposed. Combining the 4DDCS with a generalized synchronization (GS) theorem, a novel eight-dimensional discrete GS chaotic system (8DDGSCS) is constructed. Using the 8DDGSCS, a [Formula: see text]-word chaotic pseudorandom number generator (CPRNG) is designed. The keyspace of the [Formula: see text]-word CPRNG is larger than [Formula: see text]. Then, the FIPS 140-2 test suit/generalized FIPS 140-2 test suit is used to test the randomness of the 1000-key streams consisting of 20[Formula: see text]000 bits generated by the [Formula: see text]-word CPRNG, the RC4 algorithm PRNG and the ZUC algorithm PRNG, respectively. The test results show that for the three PRNGs, there are 100%/98.9%, 99.9%/98.8%, 100%/97.9% key streams passing the tests, respectively. Furthermore, the SP800-22 test suite is used to test the randomness of four 100-key streams consisting of 1000[Formula: see text]000 bits generated by four PRNGs, respectively. The numerical results show that the randomness performances of the [Formula: see text]-word CPRNG is promising, showing that there are no significant correlations between the key streams and the perturbed key streams generated via the [Formula: see text]-word CPRNG. Finally, using the [Formula: see text]-word CPRNG and the SESKPAE to encrypt two gray-scale images, test results demonstrate that the [Formula: see text]-word CPRNG is able to generate both key avalanche effect and plaintext avalanche effect, which are similar to those generated via an ideal CPRNG, and performs better than other comparable schemes.